def update_status_icon(self): """Update network profile status icon to reflect connectivity""" if self.action: # If icon has already been set by something else... return netcfg.update_profiles() profiles = netcfg.get_active_profiles() if profiles: names = [ n.name for n in profiles ] self.statusIcon.set_tooltip("Active profiles: "+",".join(names)) self.statusIcon.set_from_stock(gtk.STOCK_NETWORK) else: self.statusIcon.set_tooltip("No profiles active") self.statusIcon.set_from_stock(gtk.STOCK_DISCONNECT)
def populate_menu(self): """Loop through all menu objects to populate main menu""" self.clear_menu() netcfg.update_profiles() for section in self.menu_sections: # Each section is built by a separate command, run each passing the menu item section(self.menu) item = gtk.SeparatorMenuItem() self.menu.append(item) item = gtk.ImageMenuItem(gtk.STOCK_ABOUT) item.connect('activate', self.about) self.menu.append(item) item = gtk.ImageMenuItem(gtk.STOCK_QUIT) item.connect('activate', self.quit) self.menu.append(item)