when we right click on a tab, we switch to it, so popup menu item are correct :)

This commit is contained in:
Yann Leboulanger 2005-08-04 09:42:34 +00:00
parent d56ba58149
commit 6b26a5d332
3 changed files with 140 additions and 111 deletions

View File

@ -127,10 +127,11 @@ class Chat:
start = '* '
child = self.childs[jid]
hb = self.notebook.get_tab_label(child).get_children()[0]
if self.widget_name == 'tabbed_chat_window':
nickname = self.notebook.get_tab_label(child).get_children()[1]
nickname = hb.get_children()[1]
elif self.widget_name == 'groupchat_window':
nickname = self.notebook.get_tab_label(child).get_children()[0]
nickname = hb.get_children()[0]
#FIXME: when gtk2.4 is OOOOLD do it via glade2.10+
if gtk.pygtk_version >= (2, 6, 0) and gtk.gtk_version >= (2, 6, 0):
@ -414,6 +415,11 @@ class Chat:
self.bring_scroll_to_end(conversation_textview, diff_y - 18)
return True
def on_tab_eventbox_button_press_event(self, widget, event, child):
if event.button == 3:
n = self.notebook.page_num(child)
self.notebook.set_current_page(n)
def new_tab(self, jid):
#FIXME: text formating buttons will be hidden in 0.8 release
for w in ['bold_togglebutton', 'italic_togglebutton', 'underline_togglebutton']:
@ -495,16 +501,19 @@ class Chat:
self.notebook.set_show_tabs(True)
if self.widget_name == 'tabbed_chat_window':
xm = gtk.glade.XML(GTKGUI_GLADE, 'chat_tab_hbox', APP)
tab_hbox = xm.get_widget('chat_tab_hbox')
xm = gtk.glade.XML(GTKGUI_GLADE, 'chats_eventbox', APP)
tab_hbox = xm.get_widget('chats_eventbox')
elif self.widget_name == 'groupchat_window':
xm = gtk.glade.XML(GTKGUI_GLADE, 'groupchat_tab_hbox', APP)
tab_hbox = xm.get_widget('groupchat_tab_hbox')
xm = gtk.glade.XML(GTKGUI_GLADE, 'gc_eventbox', APP)
tab_hbox = xm.get_widget('gc_eventbox')
child = self.childs[jid]
xm.signal_connect('on_close_button_clicked',
self.on_close_button_clicked, jid)
xm.signal_connect('on_tab_eventbox_button_press_event',
self.on_tab_eventbox_button_press_event, child)
child = self.childs[jid]
self.notebook.append_page(child, tab_hbox)
message_textview = self.xmls[jid].get_widget('message_textview')
message_textview.connect('size-request', self.size_request,

View File

@ -9105,6 +9105,13 @@ Custom</property>
</packing>
</child>
<child>
<widget class="GtkEventBox" id="gc_eventbox">
<property name="visible">True</property>
<property name="visible_window">False</property>
<property name="above_child">False</property>
<signal name="button_press_event" handler="on_tab_eventbox_button_press_event" last_modification_time="Thu, 04 Aug 2005 09:38:03 GMT"/>
<child>
<widget class="GtkHBox" id="groupchat_tab_hbox">
<property name="border_width">2</property>
@ -9162,6 +9169,8 @@ Custom</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>
@ -9971,14 +9980,15 @@ Custom</property>
<signal name="focus_in_event" handler="on_tabbed_chat_window_focus_in_event" last_modification_time="Wed, 02 Mar 2005 17:57:33 GMT"/>
<signal name="delete_event" handler="on_tabbed_chat_window_delete_event" last_modification_time="Mon, 07 Mar 2005 11:06:00 GMT"/>
<signal name="destroy" handler="on_tabbed_chat_window_destroy" last_modification_time="Mon, 07 Mar 2005 16:35:25 GMT"/>
<signal name="button_press_event" handler="on_tabbed_chat_window_button_press_event" last_modification_time="Fri, 24 Jun 2005 23:54:20 GMT"/>
<signal name="button_press_event" handler="on_tabbed_chat_window_button_press_event" last_modification_time="Thu, 04 Aug 2005 08:33:10 GMT"/>
<signal name="focus_out_event" handler="on_tabbed_chat_window_focus_out_event" last_modification_time="Mon, 18 Jul 2005 22:07:30 GMT"/>
<signal name="motion_notify_event" handler="on_tabbed_chat_window_motion_notify_event" last_modification_time="Thu, 21 Jul 2005 22:24:26 GMT"/>
<child>
<widget class="GtkNotebook" id="chat_notebook">
<property name="visible">True</property>
<property name="show_tabs">False</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">False</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">True</property>
@ -10630,6 +10640,13 @@ Status message</property>
</packing>
</child>
<child>
<widget class="GtkEventBox" id="chats_eventbox">
<property name="visible">True</property>
<property name="visible_window">False</property>
<property name="above_child">False</property>
<signal name="button_press_event" handler="on_tab_eventbox_button_press_event" last_modification_time="Thu, 04 Aug 2005 09:38:11 GMT"/>
<child>
<widget class="GtkHBox" id="chat_tab_hbox">
<property name="visible">True</property>
@ -10703,6 +10720,8 @@ Status message</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>

View File

@ -212,7 +212,8 @@ class TabbedChatWindow(chat.Chat):
show = u.show
keyID = u.keyID
child = self.childs[jid]
status_image = self.notebook.get_tab_label(child).get_children()[0]
hb = self.notebook.get_tab_label(child).get_children()[0]
status_image = hb.get_children()[0]
state_images = self.plugin.roster.get_appropriate_state_images(jid)
image = state_images[show]
banner_status_image = self.xmls[jid].get_widget('banner_status_image')