Move banner agent icon in disco to glade

This commit is contained in:
shteef 2005-10-30 12:53:42 +00:00
parent 0154dc4325
commit 20213f24d3
2 changed files with 23 additions and 12 deletions

View File

@ -407,7 +407,7 @@ _('Without a connection, you can not browse available services')).get_response()
self.progressbar.set_no_show_all(True) self.progressbar.set_no_show_all(True)
self.progressbar.hide() self.progressbar.hide()
self.banner = self.xml.get_widget('banner_agent_label') self.banner = self.xml.get_widget('banner_agent_label')
self.banner_hbox = self.xml.get_widget('banner_agent_hbox') self.banner_icon = self.xml.get_widget('banner_agent_icon')
self.banner_eventbox = self.xml.get_widget('banner_agent_eventbox') self.banner_eventbox = self.xml.get_widget('banner_agent_eventbox')
self.paint_banner() self.paint_banner()
self.filter_hbox = self.xml.get_widget('filter_hbox') self.filter_hbox = self.xml.get_widget('filter_hbox')
@ -463,6 +463,8 @@ _('Without a connection, you can not browse available services')).get_response()
self.window.set_title(_('Service Discovery')) self.window.set_title(_('Service Discovery'))
self.banner.set_markup('<span weight="heavy" size="large">'\ self.banner.set_markup('<span weight="heavy" size="large">'\
'%s</span>\n' % _('Service Discovery')) '%s</span>\n' % _('Service Discovery'))
self.banner_icon.clear()
self.banner_icon.hide() # Just clearing it doesn't work
def paint_banner(self): def paint_banner(self):
"""Repaint the banner with theme color""" """Repaint the banner with theme color"""
@ -621,7 +623,6 @@ class AgentBrowser:
self._get_agent_address()) self._get_agent_address())
self.window.banner.set_markup('<span weight="heavy" size="large">'\ self.window.banner.set_markup('<span weight="heavy" size="large">'\
'%s</span>\n' % self._get_agent_address()) '%s</span>\n' % self._get_agent_address())
self._image = None
def _create_treemodel(self): def _create_treemodel(self):
"""Create the treemodel for the services treeview. When subclassing, """Create the treemodel for the services treeview. When subclassing,
@ -685,18 +686,13 @@ class AgentBrowser:
# Add an icon to the banner. # Add an icon to the banner.
pix = self.cache.get_icon(identities) pix = self.cache.get_icon(identities)
# Clear the old one if there is one (shouldn't happen, but just in case) self.window.banner_icon.set_from_pixbuf(pix)
self._clean_title() self.window.banner_icon.show()
self._image = gtk.Image()
self._image.set_from_pixbuf(pix)
self._image.set_padding(6, 6)
self.window.banner_hbox.pack_start(self._image, False, False)
self._image.show()
def _clean_title(self): def _clean_title(self):
if self._image: # Everything done here is done in window._initial_state
self._image.destroy() # This is for subclasses.
self._image = None pass
def prepare_window(self, window): def prepare_window(self, window):
"""Prepare the service discovery window. Called when a browser is hooked """Prepare the service discovery window. Called when a browser is hooked

View File

@ -2719,6 +2719,21 @@ Agent JID - node</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkImage" id="banner_agent_icon">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">6</property>
<property name="ypad">6</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>