Changeset 8955
- Timestamp:
- 11/09/07 20:30:15 (11 months ago)
- Location:
- branches/gajim_0.11.2/src
- Files:
-
- 17 modified
-
adhoc_commands.py (modified) (1 diff)
-
cell_renderer_image.py (modified) (1 diff)
-
chat_control.py (modified) (1 diff)
-
common/commands.py (modified) (1 diff)
-
common/connection_handlers.py (modified) (3 diffs)
-
common/xmpp/roster.py (modified) (1 diff)
-
common/zeroconf/client_zeroconf.py (modified) (1 diff)
-
common/zeroconf/connection_handlers_zeroconf.py (modified) (1 diff)
-
dialogs.py (modified) (1 diff)
-
disco.py (modified) (4 diffs)
-
gajim.py (modified) (3 diffs)
-
groupchat_control.py (modified) (5 diffs)
-
message_window.py (modified) (2 diffs)
-
profile_window.py (modified) (4 diffs)
-
roster_window.py (modified) (1 diff)
-
systray.py (modified) (1 diff)
-
tooltips.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.2/src/adhoc_commands.py
r8745 r8955 446 446 # commands => command selection stage 447 447 query = response.getTag('query') 448 if query :448 if query and query.getAttr('node') == xmpp.NS_COMMANDS: 449 449 items = query.getTags('item') 450 450 else: -
branches/gajim_0.11.2/src/cell_renderer_image.py
r6980 r8955 90 90 if self.image.get_storage_type() == gtk.IMAGE_ANIMATION: 91 91 if self.image not in self.iters: 92 if not isinstance(widget, gtk.TreeView): 93 return 92 94 animation = self.image.get_animation() 93 95 iter = animation.get_iter() -
branches/gajim_0.11.2/src/chat_control.py
r8709 r8955 1798 1798 window.set_events(gtk.gdk.POINTER_MOTION_MASK) 1799 1799 window.set_app_paintable(True) 1800 if gtk.gtk_version >= (2, 10, 0) and gtk.pygtk_version >= (2, 10, 0): 1801 window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP) 1800 1802 1801 1803 window.realize() -
branches/gajim_0.11.2/src/common/commands.py
r8632 r8955 259 259 jid = helpers.get_full_jid_from_iq(iq_obj) 260 260 q = iq.getTag('query') 261 # buildReply don't copy the node attribute. Re-add it 262 q.setAttr('node', xmpp.NS_COMMANDS) 261 263 262 264 for node, cmd in self.__commands.iteritems(): -
branches/gajim_0.11.2/src/common/connection_handlers.py
r8740 r8955 449 449 450 450 if real_id[:3] == 'au_': 451 gajim.socks5queue.send_file(file_props, self.name) 451 if file.has_key('stopped') and file_props['stopped']: 452 self.remove_transfer(file_props) 453 else: 454 gajim.socks5queue.send_file(file_props, self.name) 452 455 raise common.xmpp.NodeProcessed 453 456 … … 471 474 472 475 else: 473 gajim.socks5queue.send_file(file_props, self.name) 476 if file_props.has_key('stopped') and file_props['stopped']: 477 self.remove_transfer(file_props) 478 else: 479 gajim.socks5queue.send_file(file_props, self.name) 474 480 if file_props.has_key('fast'): 475 481 fasts = file_props['fast'] … … 1044 1050 self.dispatch('METACONTACTS', meta_list) 1045 1051 else: 1046 self.private_storage_supported = False 1052 if iq_obj.getErrorCode() not in ('403', '406', '404'): 1053 self.private_storage_supported = False 1047 1054 # We can now continue connection by requesting the roster 1048 1055 self.connection.initRoster() -
branches/gajim_0.11.2/src/common/xmpp/roster.py
r3112 r8955 65 65 """ Subscription tracker. Used internally for setting items state in 66 66 internal roster representation. """ 67 sender = stanza.getAttr('from') 68 if not sender == None: and not sender.bareMatch( 69 self._owner.User + '@' + self._owner.Server): 70 return 67 71 for item in stanza.getTag('query').getTags('item'): 68 72 jid=item.getAttr('jid') -
branches/gajim_0.11.2/src/common/zeroconf/client_zeroconf.py
r8716 r8955 213 213 def on_disconnect(self): 214 214 if self.conn_holder: 215 if self.conn_holder.number_of_awaiting_messages.has_key(self. conn_holder.fd):216 if self.conn_holder.number_of_awaiting_messages[self. conn_holder.fd] > 0:215 if self.conn_holder.number_of_awaiting_messages.has_key(self.fd): 216 if self.conn_holder.number_of_awaiting_messages[self.fd] > 0: 217 217 self._caller.dispatch('MSGERROR',[unicode(self.to), -1, \ 218 218 _('Connection to host could not be established'), None, None]) 219 del self.conn_holder.number_of_awaiting_messages[self. conn_holder.fd]219 del self.conn_holder.number_of_awaiting_messages[self.fd] 220 220 self.conn_holder.remove_connection(self.sock_hash) 221 221 if self.__dict__.has_key('Dispatcher'): -
branches/gajim_0.11.2/src/common/zeroconf/connection_handlers_zeroconf.py
r8699 r8955 582 582 file_props['request-id'] = unicode(iq_obj.getAttr('id')) 583 583 file_props['sid'] = unicode(si.getAttr('id')) 584 file_props['transfered_size'] = [] 584 585 gajim.socks5queue.add_file_props(self.name, file_props) 585 586 self.dispatch('FILE_REQUEST', (jid, file_props)) -
branches/gajim_0.11.2/src/dialogs.py
r8840 r8955 2392 2392 on_response_cancel = on_response_cancel) 2393 2393 2394 if on_response_cancel: 2395 self.connect('destroy', on_response_cancel) 2396 2394 2397 filter = gtk.FileFilter() 2395 2398 filter.set_name(_('All files')) -
branches/gajim_0.11.2/src/disco.py
r8691 r8955 66 66 ('server', 'im'): (ToplevelAgentBrowser, 'jabber.png'), 67 67 ('services', 'jabber'): (ToplevelAgentBrowser, 'jabber.png'), 68 ('hierarchy', 'branch'): (AgentBrowser, 'jabber.png'), 68 69 69 70 # Services … … 78 79 ('pubsub', 'service'): (PubSubBrowser, 'pubsub.png'), 79 80 ('proxy', 'bytestreams'): (None, 'bytestreams.png'), # Socks5 FT proxy 81 ('headline', 'newmail'): (ToplevelAgentBrowser, 'mail.png'), 80 82 81 83 # Transports … … 960 962 self.model.append((jid, node, item.get('name', ''), 961 963 get_agent_address(jid, node))) 964 self.cache.get_info(jid, node, self._agent_info, force = force) 962 965 963 966 def _update_item(self, iter, jid, node, item): … … 970 973 '''Called when an item should be updated in the model with further info. 971 974 The result of a disco#info query.''' 972 self.model[iter][2] = identities[0].get('name', '') 975 name = identities[0].get('name', '') 976 if name: 977 self.model[iter][2] = name 973 978 974 979 def _update_error(self, iter, jid, node): -
branches/gajim_0.11.2/src/gajim.py
r8878 r8955 24 24 from common import i18n 25 25 26 # PyGTK2.10+ only throws a warning 27 import warnings 28 warnings.filterwarnings('error', module='gtk') 29 try: 30 import gtk 31 except Warning, msg: 32 if str(msg) == 'could not open display': 33 print >> sys.stderr, _('Gajim needs X server to run. Quiting...') 34 sys.exit() 35 warnings.resetwarnings() 36 26 37 import message_control 27 38 … … 41 52 pass 42 53 43 try:44 import gtk45 except RuntimeError, msg:46 if str(msg) == 'could not open display':47 print >> sys.stderr, _('Gajim needs X server to run. Quiting...')48 sys.exit()49 54 pritext = '' 50 55 if gtk.pygtk_version < (2, 6, 0): … … 1021 1026 if self.msg_win_mgr.has_window(fjid, account): 1022 1027 ctrl = self.msg_win_mgr.get_control(fjid, account) 1023 contact = ctrl.contact 1024 contact.show = show 1025 contact.status = status 1026 ctrl.update_ui() 1027 uf_show = helpers.get_uf_show(show) 1028 if status: 1029 ctrl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, 1030 status), 'status') 1028 statusCode = array[9] 1029 if '303' in statusCode: 1030 new_nick = array[10] 1031 ctrl.print_conversation(_('%s is now known as %s') % (nick, 1032 new_nick), 'status') 1033 gc_c = gajim.contacts.get_gc_contact(account, room_jid, new_nick) 1034 c = gajim.contacts.contact_from_gc_contact(gc_c) 1035 ctrl.gc_contact = gc_c 1036 ctrl.contact = c 1037 ctrl.draw_banner() 1038 old_jid = room_jid + '/' + nick 1039 new_jid = room_jid + '/' + new_nick 1040 self.msg_win_mgr.change_key(old_jid, new_jid, account) 1031 1041 else: 1032 ctrl.print_conversation(_('%s is now %s') % (nick, uf_show), 1033 'status') 1034 ctrl.parent_win.redraw_tab(ctrl) 1042 contact = ctrl.contact 1043 contact.show = show 1044 contact.status = status 1045 uf_show = helpers.get_uf_show(show) 1046 if status: 1047 ctrl.print_conversation(_('%s is now %s (%s)') % (nick, uf_show, 1048 status), 'status') 1049 else: 1050 ctrl.print_conversation(_('%s is now %s') % (nick, uf_show), 1051 'status') 1052 ctrl.parent_win.redraw_tab(ctrl) 1053 ctrl.update_ui() 1035 1054 if self.remote_ctrl: 1036 1055 self.remote_ctrl.raise_signal('GCPresence', (account, array)) -
branches/gajim_0.11.2/src/groupchat_control.py
r8937 r8955 187 187 188 188 self.room_jid = self.contact.jid 189 self.nick = contact.name 189 self.nick = contact.name.decode('utf-8') 190 self.new_nick = '' 190 191 self.name = self.room_jid.split('@')[0] 191 192 … … 868 869 self.print_conversation(s, 'info') 869 870 elif '303' in statusCode: # Someone changed his or her nick 870 if nick == self.nick: # We changed our nick 871 self.nick = new_nick 871 if nick == self.new_nick: # We changed our nick 872 self.nick = self.new_nick 873 self.new_nick = '' 872 874 s = _('You are now known as %s') % new_nick 873 875 else: … … 896 898 os.path.join(path, puny_new_nick + ext) 897 899 for old_file in files: 898 if os.path.exists(old_file) :900 if os.path.exists(old_file) and old_file != files[old_file]: 899 901 if os.path.exists(files[old_file]): 900 902 # Windows require this … … 1107 1109 return True 1108 1110 gajim.connections[self.account].join_gc(nick, self.room_jid, None) 1111 self.new_nick = nick 1109 1112 self.clear(self.msg_textview) 1110 1113 else: … … 1389 1392 gajim.connections[self.account].join_gc(nick, self.room_jid, None) 1390 1393 self.nick = nick 1394 1391 1395 instance = dialogs.InputDialog(title, prompt, proposed_nick, 1392 1396 is_modal = False, ok_handler = on_ok) -
branches/gajim_0.11.2/src/message_window.py
r8693 r8955 439 439 nth_child = notebook.get_nth_page(page_num) 440 440 return self._widget_to_control(nth_child) 441 442 def change_key(self, old_jid, new_jid, acct): 443 '''Change the key of a control''' 444 try: 445 # Check if control exists 446 ctrl = self._controls[acct][old_jid] 447 except: 448 return 449 self._controls[acct][new_jid] = self._controls[acct][old_jid] 450 del self._controls[acct][old_jid] 441 451 442 452 def controls(self): … … 767 777 return win 768 778 779 def change_key(self, old_jid, new_jid, acct): 780 win = self.get_window(old_jid, acct) 781 if self.mode == self.ONE_MSG_WINDOW_NEVER: 782 old_key = acct + old_jid 783 if old_jid not in self._windows: 784 return 785 new_key = acct + new_jid 786 self._windows[new_key] = self._windows[old_key] 787 del self._windows[old_key] 788 win.change_key(old_jid, new_jid, acct) 789 769 790 def _on_window_delete(self, win, event): 770 791 self.save_state(self._gtk_win_to_msg_win(win)) -
branches/gajim_0.11.2/src/profile_window.py
r7940 r8955 67 67 self.jid = gajim.get_jid_from_account(account) 68 68 69 self.dialog = None 69 70 self.avatar_mime_type = None 70 71 self.avatar_encoded = None … … 99 100 gobject.source_remove(self.remove_statusbar_timeout_id) 100 101 del gajim.interface.instances[self.account]['profile'] 102 if self.dialog: # Image chooser dialog 103 self.dialog.destroy() 101 104 102 105 def on_profile_window_key_press_event(self, widget, event): … … 156 159 # rescale it 157 160 pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard') 161 self.dialog = None 158 162 button = self.xml.get_widget('PHOTO_button') 159 163 image = button.get_image() … … 173 177 def on_clear(widget): 174 178 self.dialog.destroy() 179 self.dialog = None 175 180 self.on_clear_button_clicked(widget) 176 181 177 self.dialog = dialogs.AvatarChooserDialog(on_response_ok = on_ok, 178 on_response_clear = on_clear) 182 def on_cancel(widget): 183 self.dialog.destroy() 184 self.dialog = None 185 186 if self.dialog: 187 self.dialog.present() 188 else: 189 self.dialog = dialogs.AvatarChooserDialog(on_response_ok = on_ok, 190 on_response_cancel = on_cancel, on_response_clear = on_clear) 179 191 180 192 def on_PHOTO_button_press_event(self, widget, event): -
branches/gajim_0.11.2/src/roster_window.py
r8950 r8955 2717 2717 jids 2718 2718 self.dialog = dialogs.ConfirmationDialog(pritext, sectext, 2719 on_response_ok = (on_ok , list_))2719 on_response_ok = (on_ok2, list_)) 2720 2720 2721 2721 -
branches/gajim_0.11.2/src/systray.py
r7510 r8955 317 317 'CHANGE_STATUS_MSG_MENUITEM', 'SEPARATOR', 'offline'] 318 318 index = l.index(show) 319 gajim.interface.roster.status_combobox.set_active(index) 319 current = gajim.interface.roster.status_combobox.get_active() 320 if index != current: 321 gajim.interface.roster.status_combobox.set_active(index) 322 else: 323 # We maybe need to emit the changed signal if all globaly sync'ed 324 # account don't have the global status 325 need_to_change = False 326 accounts = gajim.connections.keys() 327 for acct in accounts: 328 if not gajim.config.get_per('accounts', acct, 329 'sync_with_global_status'): 330 continue 331 acct_show = gajim.SHOW_LIST[gajim.connections[acct].connected] 332 if acct_show != show: 333 need_to_change = True 334 break 335 if need_to_change: 336 gajim.interface.roster.status_combobox.emit('changed') 320 337 321 338 def on_change_status_message_activate(self, widget): -
branches/gajim_0.11.2/src/tooltips.py
r7940 r8955 64 64 self.win.set_resizable(False) 65 65 self.win.set_name('gtk-tooltips') 66 if gtk.gtk_version >= (2, 10, 0) and gtk.pygtk_version >= (2, 10, 0): 67 self.win.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP) 66 68 67 69 self.win.set_events(gtk.gdk.POINTER_MOTION_MASK)
