Changeset 8552
- Timestamp:
- 08/22/07 19:20:44 (16 months ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
chat_control.py (modified) (2 diffs)
-
dialogs.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r8537 r8552 1774 1774 def _on_drag_data_received(self, widget, context, x, y, selection, 1775 1775 target_type, timestamp): 1776 # If no resource is known, we can't send a file 1776 if not selection.data: 1777 return 1777 1778 if self.TYPE_ID == message_control.TYPE_PM: 1778 1779 c = self.gc_contact 1779 1780 else: 1780 1781 c = self.contact 1781 if not c.resource:1782 return1783 1782 if target_type == self.TARGET_TYPE_URI_LIST: 1784 if not selection.data:1783 if not c.resource: # If no resource is known, we can't send a file 1785 1784 return 1786 1785 uri = selection.data.strip() … … 1791 1790 ft = gajim.interface.instances['file_transfers'] 1792 1791 ft.send_file(self.account, c, path) 1792 return 1793 1794 # chat2muc 1795 treeview = gajim.interface.roster.tree 1796 model = treeview.get_model() 1797 data = selection.data 1798 path = treeview.get_selection().get_selected_rows()[1][0] 1799 iter = model.get_iter(path) 1800 type = model[iter][2] 1801 account = model[iter][4].decode('utf-8') 1802 if type != 'contact': # source is not a contact 1803 return 1804 dropped_jid = data.decode('utf-8') 1805 1806 dropped_transport = gajim.get_transport_name_from_jid(dropped_jid) 1807 c_transport = gajim.get_transport_name_from_jid(c.jid) 1808 if dropped_transport or c_transport: 1809 return # transport contacts cannot be invited 1810 1811 dialogs.TransformChatToMUC(self.account, [c.jid], [dropped_jid]) 1793 1812 1794 1813 def _on_message_tv_buffer_changed(self, textbuffer): -
trunk/src/dialogs.py
r8548 r8552 3200 3200 3201 3201 class TransformChatToMUC: 3202 def __init__(self, account, jids ):3202 def __init__(self, account, jids, preselected = None): 3203 3203 '''This window is used to trasform a one-to-one chat to a MUC. 3204 3204 We do 2 things: first select the server and then make a guests list.''' … … 3206 3206 self.account = account 3207 3207 self.auto_jids = jids 3208 self.preselected_jids = preselected 3208 3209 3209 3210 self.xml = gtkgui_helpers.get_glade('chat_to_muc_window.glade') … … 3272 3273 if name == '': 3273 3274 name = jid.split('@')[0] 3274 self.store.append([img.get_pixbuf(), name, jid]) 3275 iter = self.store.append([img.get_pixbuf(), name, jid]) 3276 # preselect treeview rows 3277 if self.preselected_jids and jid in self.preselected_jids: 3278 path = self.store.get_path(iter) 3279 self.guests_treeview.get_selection().\ 3280 select_path(path) 3275 3281 3276 3282 # show all
