diff options
author | Jeremy Katz <katzj@redhat.com> | 2007-09-21 15:37:50 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2007-09-21 15:37:50 +0000 |
commit | e968673a7f7bfde094a54e6643f060c3401e8e75 (patch) | |
tree | 072300b7dcf39dc436abc594dd889f294a5c8319 | |
parent | 896f5305389f5ac6738ee56a29b5163e0dbe3999 (diff) | |
download | anaconda-e968673a7f7bfde094a54e6643f060c3401e8e75.tar.gz anaconda-e968673a7f7bfde094a54e6643f060c3401e8e75.tar.xz anaconda-e968673a7f7bfde094a54e6643f060c3401e8e75.zip |
2007-09-21 Jeremy Katz <katzj@redhat.com>
* iw/network_gui.py (NetworkWindow.setupDevices): More things
could be reasonable tooltips
* iw/checklist.py (CheckList._tipQuery): Do per-row tooltips
correctly
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | iw/checklist.py | 22 | ||||
-rw-r--r-- | iw/network_gui.py | 5 |
3 files changed, 30 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2007-09-21 Jeremy Katz <katzj@redhat.com> + * iw/network_gui.py (NetworkWindow.setupDevices): More things + could be reasonable tooltips + * iw/checklist.py (CheckList._tipQuery): Do per-row tooltips + correctly + * yuminstall.py (AnacondaYum.isGroupInstalled): These semantics are questionable for the installed system with conditionals, but they're entirely bogus for install (#296581) diff --git a/iw/checklist.py b/iw/checklist.py index e25e788e4..2e81e8391 100644 --- a/iw/checklist.py +++ b/iw/checklist.py @@ -67,6 +67,21 @@ class CheckList (gtk.TreeView): # iterate over them all self.num_rows = 0 + self.tiptext = {} + self.props.has_tooltip = True + self.connect("query-tooltip", self._tipQuery) + + def _tipQuery(self, widget, x, y, kbd, tip, *data): + (tx, ty) = widget.convert_widget_to_bin_window_coords(x, y) + r = widget.get_path_at_pos(tx, ty) + if not r: + return False + path = r[0] + if not self.tiptext.has_key(path): + return False + tip.set_text(self.tiptext[path]) + return True + def append_row (self, textList, init_value, tooltipText = None): """Add a row to the list. text: text to display in the row @@ -82,8 +97,10 @@ class CheckList (gtk.TreeView): self.store.set_value(iter, i, textList[i - 1]) i = i + 1 + if tooltipText: + self.tiptext[self.store.get_path(iter)] = tooltipText + self.num_rows = self.num_rows + 1 - self.props.tooltip_markup = tooltipText def toggled_item(self, data, row): @@ -166,12 +183,13 @@ def main(): win = gtk.Window() cl = CheckList(1) for i in range(1, 10): - cl.append_row("%s" %(i,), False) + cl.append_row("%s" %(i,), False, "foo: %d" %(i,)) sw = gtk.ScrolledWindow() sw.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) sw.add (cl) sw.set_shadow_type(gtk.SHADOW_IN) + cl.set_headers_visible(True) win.add(sw) win.set_size_request(250, 250) diff --git a/iw/network_gui.py b/iw/network_gui.py index 19f76465d..739d49135 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -387,6 +387,11 @@ class NetworkWindow(InstallWindow): self.devices[device].info.has_key('DESC'): devdesc = "%s - %s" % (self.devices[device].info["HWADDR"], self.devices[device].info["DESC"]) + elif self.devices[device].info.has_key('HWADDR'): + devdesc = self.devices[device].info["HWADDR"] + elif self.devices[device].info.has_key('DESC'): + devdesc = self.devices[device].info["DESC"] + self.ethdevices.append_row((device, ipv4, ipv6), active, tooltipText=devdesc) num += 1 |