fixes allover
This commit is contained in:
parent
fd836e2a6d
commit
75fb6ac1f7
6 changed files with 35 additions and 28 deletions
|
@ -74,7 +74,7 @@ class Chat:
|
||||||
del self.print_time_timeout_id[jid]
|
del self.print_time_timeout_id[jid]
|
||||||
else:
|
else:
|
||||||
for jid in self.xmls:
|
for jid in self.xmls:
|
||||||
if not self.print_time_timeout_id.has_key(jid):
|
if not self.print_time_timeout_id.has_key(pjid):
|
||||||
self.print_time_timeout(jid)
|
self.print_time_timeout(jid)
|
||||||
self.print_time_timeout_id[jid] = gobject.timeout_add(300000, \
|
self.print_time_timeout_id[jid] = gobject.timeout_add(300000, \
|
||||||
self.print_time_timeout, jid)
|
self.print_time_timeout, jid)
|
||||||
|
@ -91,11 +91,15 @@ class Chat:
|
||||||
start = "* "
|
start = "* "
|
||||||
chat = self.names[jid]
|
chat = self.names[jid]
|
||||||
if len(self.xmls) > 1: # if more than one tabs in the same window
|
if len(self.xmls) > 1: # if more than one tabs in the same window
|
||||||
|
if isinstance(self.window, Tabbed_chat_window):
|
||||||
chat = 'Chat'
|
chat = 'Chat'
|
||||||
|
elif isinstance(self.window, Groupchat_window):
|
||||||
|
chat = 'Groupchat'
|
||||||
if len(self.plugin.accounts.keys()) >= 2: # if we have 2 or more accounts
|
if len(self.plugin.accounts.keys()) >= 2: # if we have 2 or more accounts
|
||||||
title = start + chat + ' (account: ' + self.account + ')'
|
title = start + chat + ' (account: ' + self.account + ')'
|
||||||
else:
|
else:
|
||||||
title = start + chat
|
title = start + chat
|
||||||
|
|
||||||
self.window.set_title(title)
|
self.window.set_title(title)
|
||||||
|
|
||||||
def redraw_tab(self, jid):
|
def redraw_tab(self, jid):
|
||||||
|
@ -270,9 +274,6 @@ class Chat:
|
||||||
current = self.notebook.get_current_page()
|
current = self.notebook.get_current_page()
|
||||||
if current > 0:
|
if current > 0:
|
||||||
self.notebook.set_current_page(current-1)
|
self.notebook.set_current_page(current-1)
|
||||||
# else:
|
|
||||||
# self.notebook.set_current_page(\
|
|
||||||
# self.notebook.get_n_pages()-1)
|
|
||||||
elif event.state & gtk.gdk.SHIFT_MASK:
|
elif event.state & gtk.gdk.SHIFT_MASK:
|
||||||
conversation_textview = self.xmls[jid].\
|
conversation_textview = self.xmls[jid].\
|
||||||
get_widget('conversation_textview')
|
get_widget('conversation_textview')
|
||||||
|
@ -285,9 +286,8 @@ class Chat:
|
||||||
current = self.notebook.get_current_page()
|
current = self.notebook.get_current_page()
|
||||||
if current < (self.notebook.get_n_pages()-1):
|
if current < (self.notebook.get_n_pages()-1):
|
||||||
self.notebook.set_current_page(current+1)
|
self.notebook.set_current_page(current+1)
|
||||||
# else:
|
|
||||||
# self.notebook.set_current_page(0)
|
|
||||||
elif event.state & gtk.gdk.SHIFT_MASK:
|
elif event.state & gtk.gdk.SHIFT_MASK:
|
||||||
|
print 'yes'
|
||||||
conversation_textview = self.xmls[jid].\
|
conversation_textview = self.xmls[jid].\
|
||||||
get_widget('conversation_textview')
|
get_widget('conversation_textview')
|
||||||
rect = conversation_textview.get_visible_rect()
|
rect = conversation_textview.get_visible_rect()
|
||||||
|
|
|
@ -7824,7 +7824,7 @@ Custom</property>
|
||||||
<property name="width_request">303</property>
|
<property name="width_request">303</property>
|
||||||
<property name="height_request">225</property>
|
<property name="height_request">225</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="title" translatable="yes">Status Message for</property>
|
<property name="title" translatable="yes"></property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||||
<property name="modal">False</property>
|
<property name="modal">False</property>
|
||||||
|
@ -9030,6 +9030,12 @@ send a chat message to</property>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkSeparatorMenuItem" id="separator4">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuItem" id="offline_menuitem">
|
<widget class="GtkMenuItem" id="offline_menuitem">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -9058,7 +9064,7 @@ send a chat message to</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child internal-child="image">
|
<child internal-child="image">
|
||||||
<widget class="GtkImage" id="image472">
|
<widget class="GtkImage" id="image473">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="stock">gtk-new</property>
|
<property name="stock">gtk-new</property>
|
||||||
<property name="icon_size">1</property>
|
<property name="icon_size">1</property>
|
||||||
|
|
|
@ -260,7 +260,7 @@ class roster_window:
|
||||||
for account in self.plugin.accounts.keys():
|
for account in self.plugin.accounts.keys():
|
||||||
item = gtk.MenuItem(_('using ') + account + _(' account'))
|
item = gtk.MenuItem(_('using ') + account + _(' account'))
|
||||||
sub_menu.append(item)
|
sub_menu.append(item)
|
||||||
item.connect("activate", self.on_join_gc, account)
|
item.connect("activate", self.on_join_gc_activate, account)
|
||||||
sub_menu.show_all()
|
sub_menu.show_all()
|
||||||
#new message
|
#new message
|
||||||
sub_menu = gtk.Menu()
|
sub_menu = gtk.Menu()
|
||||||
|
@ -282,7 +282,7 @@ class roster_window:
|
||||||
#join_gc
|
#join_gc
|
||||||
if not self.join_gc_handler_id:
|
if not self.join_gc_handler_id:
|
||||||
self.join_gc_handler_id = join_gc_menuitem.connect(\
|
self.join_gc_handler_id = join_gc_menuitem.connect(\
|
||||||
'activate', self.on_join_gc, self.plugin.accounts.keys()[0])
|
'activate', self.on_join_gc_activate, self.plugin.accounts.keys()[0])
|
||||||
if not self.new_message_menuitem_handler_id:
|
if not self.new_message_menuitem_handler_id:
|
||||||
self.new_message_menuitem_handler_id = new_message_menuitem.connect(\
|
self.new_message_menuitem_handler_id = new_message_menuitem.connect(\
|
||||||
'activate', self.on_new_message_menuitem_activate, self.plugin.accounts.keys()[0])
|
'activate', self.on_new_message_menuitem_activate, self.plugin.accounts.keys()[0])
|
||||||
|
@ -555,11 +555,12 @@ class roster_window:
|
||||||
item = gtk.MenuItem(_("_Add contact"))
|
item = gtk.MenuItem(_("_Add contact"))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
item.connect("activate", self.on_add_contact, account)
|
item.connect("activate", self.on_add_contact, account)
|
||||||
|
item = gtk.MenuItem(_('Join _groupchat'))
|
||||||
|
menu.append(item)
|
||||||
|
item.connect("activate", self.on_join_gc_activate, account)
|
||||||
item = gtk.MenuItem(_('_New message'))
|
item = gtk.MenuItem(_('_New message'))
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
item.connect("activate", self.on_new_message_menuitem_activate, account)
|
item.connect("activate", self.on_new_message_menuitem_activate, account)
|
||||||
if self.plugin.connected[account] < 2:
|
|
||||||
item.set_sensitive(False)
|
|
||||||
|
|
||||||
menu.popup(None, None, None, event.button, event.time)
|
menu.popup(None, None, None, event.button, event.time)
|
||||||
menu.show_all()
|
menu.show_all()
|
||||||
|
@ -804,7 +805,7 @@ class roster_window:
|
||||||
if self.plugin.config['usetabbedchat']:
|
if self.plugin.config['usetabbedchat']:
|
||||||
if not self.plugin.windows[account]['chats'].has_key('tabbed'):
|
if not self.plugin.windows[account]['chats'].has_key('tabbed'):
|
||||||
self.plugin.windows[account]['chats']['tabbed'] = \
|
self.plugin.windows[account]['chats']['tabbed'] = \
|
||||||
tabbed_chat_window(user, self.plugin, account)
|
Tabbed_chat_window(user, self.plugin, account)
|
||||||
else:
|
else:
|
||||||
self.plugin.windows[account]['chats']['tabbed'].new_user(user)
|
self.plugin.windows[account]['chats']['tabbed'].new_user(user)
|
||||||
|
|
||||||
|
@ -814,7 +815,7 @@ class roster_window:
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.plugin.windows[account]['chats'][user.jid] = \
|
self.plugin.windows[account]['chats'][user.jid] = \
|
||||||
tabbed_chat_window(user, self.plugin, account)
|
Tabbed_chat_window(user, self.plugin, account)
|
||||||
|
|
||||||
def new_group(self, jid, nick, account):
|
def new_group(self, jid, nick, account):
|
||||||
if self.plugin.config['usetabbedchat']:
|
if self.plugin.config['usetabbedchat']:
|
||||||
|
@ -889,7 +890,7 @@ class roster_window:
|
||||||
call the add_contact_window class"""
|
call the add_contact_window class"""
|
||||||
add_contact_window(self.plugin, account)
|
add_contact_window(self.plugin, account)
|
||||||
|
|
||||||
def on_join_gc(self, widget, account):
|
def on_join_gc_activate(self, widget, account):
|
||||||
"""When Join Groupchat is selected :
|
"""When Join Groupchat is selected :
|
||||||
call the join_gc class"""
|
call the join_gc class"""
|
||||||
join_groupchat_window(self.plugin, account)
|
join_groupchat_window(self.plugin, account)
|
||||||
|
|
|
@ -38,7 +38,7 @@ gtk.glade.textdomain(APP)
|
||||||
|
|
||||||
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
|
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
|
||||||
|
|
||||||
class tabbed_chat_window(Chat):
|
class Tabbed_chat_window(Chat):
|
||||||
"""Class for tabbed chat window"""
|
"""Class for tabbed chat window"""
|
||||||
def __init__(self, user, plugin, account):
|
def __init__(self, user, plugin, account):
|
||||||
Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
||||||
|
@ -150,10 +150,10 @@ class tabbed_chat_window(Chat):
|
||||||
and printed in the conversation"""
|
and printed in the conversation"""
|
||||||
if event.keyval == gtk.keysyms.Return:
|
if event.keyval == gtk.keysyms.Return:
|
||||||
if (event.state & gtk.gdk.SHIFT_MASK):
|
if (event.state & gtk.gdk.SHIFT_MASK):
|
||||||
return 0
|
return False
|
||||||
if self.plugin.connected[self.account] < 2: #we are not connected
|
if self.plugin.connected[self.account] < 2: #we are not connected
|
||||||
Error_dialog(_('You are not connected, so you cannot send a message'))
|
Error_dialog(_('You are not connected, so you cannot send a message'))
|
||||||
return 1
|
return True
|
||||||
message_buffer = widget.get_buffer()
|
message_buffer = widget.get_buffer()
|
||||||
start_iter = message_buffer.get_start_iter()
|
start_iter = message_buffer.get_start_iter()
|
||||||
end_iter = message_buffer.get_end_iter()
|
end_iter = message_buffer.get_end_iter()
|
||||||
|
@ -166,8 +166,8 @@ class tabbed_chat_window(Chat):
|
||||||
self.plugin.send('MSG', self.account, (jid, message, keyID))
|
self.plugin.send('MSG', self.account, (jid, message, keyID))
|
||||||
message_buffer.set_text('', -1)
|
message_buffer.set_text('', -1)
|
||||||
self.print_conversation(message, jid, jid)
|
self.print_conversation(message, jid, jid)
|
||||||
return 1
|
return True
|
||||||
return 0
|
return False
|
||||||
|
|
||||||
def on_contact_button_clicked(self, widget):
|
def on_contact_button_clicked(self, widget):
|
||||||
"""When button contact is clicked"""
|
"""When button contact is clicked"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue