diff options
author | Dan Williams <dcbw@redhat.com> | 2006-04-26 16:25:40 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2006-04-26 16:25:40 (GMT) |
commit | 9df61cb84b8b6cf572b7e9af2bb7b6afd56fec14 (patch) | |
tree | 04cc151fffcd86d20d3f09265e53485a65a8edda /shell/src | |
parent | 329fea5a73940a70c1f4efa1c367f6b3debe6f75 (diff) |
Add support for setting the tab icon.
Diffstat (limited to 'shell/src')
-rwxr-xr-x | shell/src/shell.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/shell/src/shell.py b/shell/src/shell.py index c1b0362..9230c11 100755 --- a/shell/src/shell.py +++ b/shell/src/shell.py @@ -40,7 +40,7 @@ class ActivityHost(dbus.service.Object): self.tab_activity_image = gtk.Image() self.tab_activity_image.set_from_stock(gtk.STOCK_CONVERT, gtk.ICON_SIZE_MENU) hbox.pack_start(self.tab_activity_image) - self.tab_activity_image.show() + #self.tab_activity_image.show() self.label_hbox = gtk.HBox(False, 4); self.label_hbox.connect("style-set", self.__tab_label_style_set_cb) @@ -121,12 +121,35 @@ class ActivityHost(dbus.service.Object): self.tab_close_button.hide() @dbus.service.method("com.redhat.Sugar.Shell.ActivityHost", \ + in_signature="b", \ + out_signature="") + def set_tab_show_icon(self, show_icon): + if show_icon: + self.tab_activity_image.show() + else: + self.tab_activity_image.hide() + + @dbus.service.method("com.redhat.Sugar.Shell.ActivityHost", \ in_signature="s", \ out_signature="") def set_tab_text(self, text): self.tab_label.set_text(text) @dbus.service.method("com.redhat.Sugar.Shell.ActivityHost", \ + in_signature="ayibiiii", \ + out_signature="") + def set_tab_icon(self, data, colorspace, has_alpha, bits_per_sample, width, height, rowstride): + print "width=%d, height=%d"%(width, height) + print " data = ", data + pixstr = "" + for c in data: + pixstr += chr(c) + + pixbuf = gtk.gdk.pixbuf_new_from_data(pixstr, colorspace, has_alpha, bits_per_sample, width, height, rowstride) + print pixbuf + self.tab_activity_image.set_from_pixbuf(pixbuf) + + @dbus.service.method("com.redhat.Sugar.Shell.ActivityHost", \ in_signature="", \ out_signature="") def shutdown(self): |