| 1041 | | add_to_roster_button = self.xml.get_widget('add_to_roster_button') |
| 1042 | | id = add_to_roster_button.connect('clicked', self._on_add_to_roster_menuitem_activate) |
| 1043 | | self.handlers[id] = add_to_roster_button |
| 1044 | | |
| 1045 | | send_file_button = self.xml.get_widget('send_file_button') |
| 1046 | | id = send_file_button.connect('clicked', self._on_send_file_menuitem_activate) |
| 1047 | | self.handlers[id] = send_file_button |
| 1048 | | |
| 1049 | | convert_to_gc_button = self.xml.get_widget('convert_to_gc_button') |
| 1050 | | id = convert_to_gc_button.connect('clicked', self._on_convert_to_gc_menuitem_activate) |
| 1051 | | self.handlers[id] = convert_to_gc_button |
| 1052 | | |
| 1053 | | contact_information_button = self.xml.get_widget('contact_information_button') |
| 1054 | | id = contact_information_button.connect('clicked', self._on_contact_information_menuitem_activate) |
| | 1041 | self._add_to_roster_button = self.xml.get_widget( |
| | 1042 | 'add_to_roster_button') |
| | 1043 | id = self._add_to_roster_button.connect('clicked', |
| | 1044 | self._on_add_to_roster_menuitem_activate) |
| | 1045 | self.handlers[id] = self._add_to_roster_button |
| | 1046 | |
| | 1047 | self._send_file_button = self.xml.get_widget('send_file_button') |
| | 1048 | id = self._send_file_button.connect('clicked', |
| | 1049 | self._on_send_file_menuitem_activate) |
| | 1050 | self.handlers[id] = self._send_file_button |
| | 1051 | |
| | 1052 | self._convert_to_gc_button = self.xml.get_widget( |
| | 1053 | 'convert_to_gc_button') |
| | 1054 | id = self._convert_to_gc_button.connect('clicked', |
| | 1055 | self._on_convert_to_gc_menuitem_activate) |
| | 1056 | self.handlers[id] = self._convert_to_gc_button |
| | 1057 | |
| | 1058 | contact_information_button = self.xml.get_widget( |
| | 1059 | 'contact_information_button') |
| | 1060 | id = contact_information_button.connect('clicked', |
| | 1061 | self._on_contact_information_menuitem_activate) |
| 1072 | | img.set_from_pixbuf(gtkgui_helpers.load_icon('muc_active').get_pixbuf()) |
| 1073 | | |
| 1074 | | # Add to roster button |
| 1075 | | if _('Not in Roster') in contact.groups: |
| 1076 | | add_to_roster_button.show() |
| 1077 | | |
| 1078 | | # If we don't have resource, we can't do file transfer |
| 1079 | | # in transports, contact holds our info we need to disable it too |
| 1080 | | if gajim.capscache.is_supported(contact, NS_FILE): |
| 1081 | | send_file_button.set_sensitive(True) |
| 1082 | | else: |
| 1083 | | send_file_button.set_sensitive(False) |
| 1084 | | |
| 1085 | | # check if it's possible to convert to groupchat |
| 1086 | | if gajim.capscache.is_supported(contact, NS_MUC): |
| 1087 | | convert_to_gc_button.set_sensitive(True) |
| 1088 | | else: |
| 1089 | | convert_to_gc_button.set_sensitive(False) |
| | 1081 | img.set_from_pixbuf(gtkgui_helpers.load_icon( |
| | 1082 | 'muc_active').get_pixbuf()) |
| | 1083 | |
| | 1084 | self.update_toolbar() |
| | 1170 | def update_toolbar(self): |
| | 1171 | # Add to roster |
| | 1172 | if _('Not in Roster') in self.contact.groups: |
| | 1173 | self._add_to_roster_button.show() |
| | 1174 | else: |
| | 1175 | self._add_to_roster_button.hide() |
| | 1176 | |
| | 1177 | # Send file |
| | 1178 | if gajim.capscache.is_supported(self.contact, NS_FILE): |
| | 1179 | self._send_file_button.set_sensitive(True) |
| | 1180 | else: |
| | 1181 | self._send_file_button.set_sensitive(False) |
| | 1182 | |
| | 1183 | # Convert to GC |
| | 1184 | if gajim.capscache.is_supported(self.contact, NS_MUC): |
| | 1185 | self._convert_to_gc_button.set_sensitive(True) |
| | 1186 | else: |
| | 1187 | self._convert_to_gc_button.set_sensitive(False) |
| | 1188 | |