I tried everything. In the end I did it the normal way. Focus works on message_textview. Yann have a look if you want to make the same thing in GC
This commit is contained in:
parent
747be28ef9
commit
772e6c3310
3 changed files with 29 additions and 92 deletions
|
@ -623,8 +623,6 @@ class New_message_window:
|
|||
self.account = account
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'new_message_window', APP)
|
||||
self.window = self.xml.get_widget('new_message_window')
|
||||
self.jid_entry = self.xml.get_widget('jid_entry')
|
||||
self.jid_entry.set_activates_default(True)
|
||||
self.xml.signal_autoconnect(self)
|
||||
self.plugin.windows['new_message'] = self # now add us to open windows
|
||||
|
||||
|
|
|
@ -7307,7 +7307,7 @@ Custom</property>
|
|||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -7322,13 +7322,14 @@ Custom</property>
|
|||
<widget class="GtkEntry" id="room_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -7349,7 +7350,7 @@ Custom</property>
|
|||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -7365,12 +7366,12 @@ Custom</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -7933,6 +7934,7 @@ Custom</property>
|
|||
|
||||
<widget class="GtkWindow" id="tabbed_chat_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="title" translatable="yes">Chat</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
|
@ -7977,7 +7979,6 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkButton" id="history_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_history_button_clicked" last_modification_time="Wed, 02 Mar 2005 17:03:17 GMT"/>
|
||||
|
@ -8052,70 +8053,11 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkButton" id="clear_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-clear</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_clear_button_clicked" last_modification_time="Wed, 02 Mar 2005 17:03:09 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment46">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2923">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image411">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-clear</property>
|
||||
<property name="icon_size">4</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label204">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -8144,14 +8086,13 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkToggleButton" id="gpg_togglebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image413">
|
||||
<widget class="GtkImage" id="image433">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-dialog-authentication</property>
|
||||
<property name="icon_size">4</property>
|
||||
|
@ -8180,7 +8121,6 @@ Custom</property>
|
|||
<property name="height_request">0</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Click for contact's extented information</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Anonymous <id@server/res></property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
|
@ -8203,13 +8143,12 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkButton" id="close_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_close_button_clicked" last_modification_time="Wed, 02 Mar 2005 21:05:12 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image414">
|
||||
<widget class="GtkImage" id="image434">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-close</property>
|
||||
<property name="icon_size">4</property>
|
||||
|
@ -8237,13 +8176,11 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkVPaned" id="vpaned3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="position">170</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="conversation_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
|
@ -8253,7 +8190,6 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkTextView" id="conversation_textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="overwrite">False</property>
|
||||
<property name="accepts_tab">True</property>
|
||||
|
@ -8281,7 +8217,6 @@ Custom</property>
|
|||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow31">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
|
@ -8291,7 +8226,6 @@ Custom</property>
|
|||
<widget class="GtkTextView" id="message_textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="overwrite">False</property>
|
||||
<property name="accepts_tab">True</property>
|
||||
|
@ -8437,7 +8371,7 @@ send a chat message to</property>
|
|||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -222,6 +222,7 @@ class tabbed_chat_window:
|
|||
self.on_tabbed_chat_window_key_press_event)
|
||||
self.xml.signal_connect('on_chat_notebook_switch_page', \
|
||||
self.on_chat_notebook_switch_page)
|
||||
#self.xml.signal_autoconnect(self) #FIXME: (nk) THIS SEGFAULTS GAJIM. WHY?
|
||||
|
||||
def update_tags(self):
|
||||
for jid in self.tagIn:
|
||||
|
@ -363,7 +364,6 @@ class tabbed_chat_window:
|
|||
child = self.xmls[jid].get_widget('chat_vbox')
|
||||
self.chat_notebook.set_current_page(\
|
||||
self.chat_notebook.page_num(child))
|
||||
self.xmls[jid].get_widget('message_textview').grab_focus()
|
||||
|
||||
def remove_tab(self, jid):
|
||||
if len(self.xmls) == 1:
|
||||
|
@ -444,14 +444,14 @@ class tabbed_chat_window:
|
|||
return 0
|
||||
|
||||
def on_tabbed_chat_window_key_press_event(self, widget, event):
|
||||
st = "1234567890"
|
||||
st = '1234567890' # zero is here cause humans count from 1, pc from 0 :P
|
||||
jid = self.get_active_jid()
|
||||
if event.keyval == gtk.keysyms.Escape:
|
||||
if event.keyval == gtk.keysyms.Escape: # ESCAPE
|
||||
self.remove_tab(jid)
|
||||
elif event.string and event.string in st \
|
||||
and (event.state & gtk.gdk.MOD1_MASK):
|
||||
and (event.state & gtk.gdk.MOD1_MASK): # alt + 1,2,3..
|
||||
self.chat_notebook.set_current_page(st.index(event.string))
|
||||
elif event.keyval == gtk.keysyms.Page_Down:
|
||||
elif event.keyval == gtk.keysyms.Page_Down: # PAGE DOWN
|
||||
if event.state & gtk.gdk.CONTROL_MASK:
|
||||
current = self.chat_notebook.get_current_page()
|
||||
if current > 0:
|
||||
|
@ -466,7 +466,7 @@ class tabbed_chat_window:
|
|||
iter = conversation_textview.get_iter_at_location(rect.x,\
|
||||
rect.y + rect.height)
|
||||
conversation_textview.scroll_to_iter(iter, 0.1, True, 0, 0)
|
||||
elif event.keyval == gtk.keysyms.Page_Up:
|
||||
elif event.keyval == gtk.keysyms.Page_Up: # PAGE UP
|
||||
if event.state & gtk.gdk.CONTROL_MASK:
|
||||
current = self.chat_notebook.get_current_page()
|
||||
if current < (self.chat_notebook.get_n_pages()-1):
|
||||
|
@ -480,12 +480,17 @@ class tabbed_chat_window:
|
|||
iter = conversation_textview.get_iter_at_location(rect.x, rect.y)
|
||||
conversation_textview.scroll_to_iter(iter, 0.1, True, 0, 1)
|
||||
elif event.keyval == gtk.keysyms.Tab and \
|
||||
(event.state & gtk.gdk.CONTROL_MASK):
|
||||
(event.state & gtk.gdk.CONTROL_MASK): # CTRL + TAB
|
||||
current = self.chat_notebook.get_current_page()
|
||||
if current < (self.chat_notebook.get_n_pages()-1):
|
||||
self.chat_notebook.set_current_page(current+1)
|
||||
else:
|
||||
self.chat_notebook.set_current_page(0)
|
||||
else: # it's a normal key press make sure message_textview has focus
|
||||
message_textview = self.xmls[jid].\
|
||||
get_widget('message_textview')
|
||||
if not message_textview.is_focus():
|
||||
message_textview.grab_focus()
|
||||
|
||||
def on_contact_button_clicked(self, widget):
|
||||
"""When button contact is clicked"""
|
||||
|
@ -2343,9 +2348,9 @@ class roster_window:
|
|||
return 1
|
||||
|
||||
def mkemoticons(self):
|
||||
"""initialize emoticons array"""
|
||||
self.emoticons = {}
|
||||
self.begin_emot = ""
|
||||
"""initialize emoticons dictionary"""
|
||||
self.emoticons = dict()
|
||||
self.begin_emot = ''
|
||||
split_line = string.split(self.plugin.config['emoticons'], '\t')
|
||||
for i in range(0, len(split_line)/2):
|
||||
file = split_line[2*i+1]
|
||||
|
@ -2832,7 +2837,7 @@ class plugin:
|
|||
argv.append(file)
|
||||
try:
|
||||
os.execvp(argv[0], argv)
|
||||
except:
|
||||
except:
|
||||
print _("error while running %s :") % string.join(argv, ' '), \
|
||||
sys.exc_info()[1]
|
||||
os._exit(1)
|
||||
|
|
Loading…
Add table
Reference in a new issue