Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
52b2b17c
Commit
52b2b17c
authored
12 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
return True in accel_group callback. Fixes #5371, #6903
parent
4f6687e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/message_window.py
+23
-4
23 additions, 4 deletions
src/message_window.py
with
23 additions
and
4 deletions
src/message_window.py
+
23
−
4
View file @
52b2b17c
...
@@ -110,7 +110,7 @@ class MessageWindow(object):
...
@@ -110,7 +110,7 @@ class MessageWindow(object):
for
key
in
keys
:
for
key
in
keys
:
keyval
,
mod
=
gtk
.
accelerator_parse
(
key
)
keyval
,
mod
=
gtk
.
accelerator_parse
(
key
)
accel_group
.
connect_group
(
keyval
,
mod
,
gtk
.
ACCEL_VISIBLE
,
accel_group
.
connect_group
(
keyval
,
mod
,
gtk
.
ACCEL_VISIBLE
,
self
.
accel_group_func
)
self
.
accel_group_func
)
self
.
window
.
add_accel_group
(
accel_group
)
self
.
window
.
add_accel_group
(
accel_group
)
# gtk+ doesn't make use of the motion notify on gtkwindow by default
# gtk+ doesn't make use of the motion notify on gtkwindow by default
...
@@ -118,10 +118,10 @@ class MessageWindow(object):
...
@@ -118,10 +118,10 @@ class MessageWindow(object):
self
.
window
.
add_events
(
gtk
.
gdk
.
POINTER_MOTION_MASK
)
self
.
window
.
add_events
(
gtk
.
gdk
.
POINTER_MOTION_MASK
)
id_
=
self
.
notebook
.
connect
(
'
switch-page
'
,
id_
=
self
.
notebook
.
connect
(
'
switch-page
'
,
self
.
_on_notebook_switch_page
)
self
.
_on_notebook_switch_page
)
self
.
handlers
[
id_
]
=
self
.
notebook
self
.
handlers
[
id_
]
=
self
.
notebook
id_
=
self
.
notebook
.
connect
(
'
key-press-event
'
,
id_
=
self
.
notebook
.
connect
(
'
key-press-event
'
,
self
.
_on_notebook_key_press
)
self
.
_on_notebook_key_press
)
self
.
handlers
[
id_
]
=
self
.
notebook
self
.
handlers
[
id_
]
=
self
.
notebook
# Tab customizations
# Tab customizations
...
@@ -351,6 +351,7 @@ class MessageWindow(object):
...
@@ -351,6 +351,7 @@ class MessageWindow(object):
if
modifier
&
gtk
.
gdk
.
CONTROL_MASK
:
if
modifier
&
gtk
.
gdk
.
CONTROL_MASK
:
if
keyval
==
gtk
.
keysyms
.
h
:
# CTRL + h
if
keyval
==
gtk
.
keysyms
.
h
:
# CTRL + h
control
.
_on_history_menuitem_activate
()
control
.
_on_history_menuitem_activate
()
return
True
elif
control
.
type_id
==
message_control
.
TYPE_CHAT
and
\
elif
control
.
type_id
==
message_control
.
TYPE_CHAT
and
\
keyval
==
gtk
.
keysyms
.
f
:
# CTRL + f
keyval
==
gtk
.
keysyms
.
f
:
# CTRL + f
# CTRL + f moves cursor one char forward when user uses Emacs
# CTRL + f moves cursor one char forward when user uses Emacs
...
@@ -358,28 +359,36 @@ class MessageWindow(object):
...
@@ -358,28 +359,36 @@ class MessageWindow(object):
if
not
gtk
.
settings_get_default
().
get_property
(
if
not
gtk
.
settings_get_default
().
get_property
(
'
gtk-key-theme-name
'
)
==
'
Emacs
'
:
'
gtk-key-theme-name
'
)
==
'
Emacs
'
:
control
.
_on_send_file_menuitem_activate
(
None
)
control
.
_on_send_file_menuitem_activate
(
None
)
return
True
elif
control
.
type_id
==
message_control
.
TYPE_CHAT
and
\
elif
control
.
type_id
==
message_control
.
TYPE_CHAT
and
\
keyval
==
gtk
.
keysyms
.
g
:
# CTRL + g
keyval
==
gtk
.
keysyms
.
g
:
# CTRL + g
control
.
_on_convert_to_gc_menuitem_activate
(
None
)
control
.
_on_convert_to_gc_menuitem_activate
(
None
)
return
True
elif
control
.
type_id
in
(
message_control
.
TYPE_CHAT
,
elif
control
.
type_id
in
(
message_control
.
TYPE_CHAT
,
message_control
.
TYPE_PM
)
and
keyval
==
gtk
.
keysyms
.
i
:
# CTRL + i
message_control
.
TYPE_PM
)
and
keyval
==
gtk
.
keysyms
.
i
:
# CTRL + i
control
.
_on_contact_information_menuitem_activate
(
None
)
control
.
_on_contact_information_menuitem_activate
(
None
)
return
True
elif
keyval
==
gtk
.
keysyms
.
l
or
keyval
==
gtk
.
keysyms
.
L
:
# CTRL + l|L
elif
keyval
==
gtk
.
keysyms
.
l
or
keyval
==
gtk
.
keysyms
.
L
:
# CTRL + l|L
control
.
conv_textview
.
clear
()
control
.
conv_textview
.
clear
()
return
True
elif
keyval
==
gtk
.
keysyms
.
u
:
# CTRL + u: emacs style clear line
elif
keyval
==
gtk
.
keysyms
.
u
:
# CTRL + u: emacs style clear line
control
.
clear
(
control
.
msg_textview
)
control
.
clear
(
control
.
msg_textview
)
return
True
elif
control
.
type_id
==
message_control
.
TYPE_GC
and
\
elif
control
.
type_id
==
message_control
.
TYPE_GC
and
\
keyval
==
gtk
.
keysyms
.
b
:
# CTRL + b
keyval
==
gtk
.
keysyms
.
b
:
# CTRL + b
control
.
_on_bookmark_room_menuitem_activate
(
None
)
control
.
_on_bookmark_room_menuitem_activate
(
None
)
return
True
# Tab switch bindings
# Tab switch bindings
elif
keyval
==
gtk
.
keysyms
.
F4
:
# CTRL + F4
elif
keyval
==
gtk
.
keysyms
.
F4
:
# CTRL + F4
self
.
remove_tab
(
control
,
self
.
CLOSE_CTRL_KEY
)
self
.
remove_tab
(
control
,
self
.
CLOSE_CTRL_KEY
)
return
True
elif
keyval
==
gtk
.
keysyms
.
w
:
# CTRL + w
elif
keyval
==
gtk
.
keysyms
.
w
:
# CTRL + w
# CTRL + w removes latest word before sursor when User uses emacs
# CTRL + w removes latest word before sursor when User uses emacs
# theme
# theme
if
not
gtk
.
settings_get_default
().
get_property
(
if
not
gtk
.
settings_get_default
().
get_property
(
'
gtk-key-theme-name
'
)
==
'
Emacs
'
:
'
gtk-key-theme-name
'
)
==
'
Emacs
'
:
self
.
remove_tab
(
control
,
self
.
CLOSE_CTRL_KEY
)
self
.
remove_tab
(
control
,
self
.
CLOSE_CTRL_KEY
)
return
True
elif
keyval
in
(
gtk
.
keysyms
.
Page_Up
,
gtk
.
keysyms
.
Page_Down
):
elif
keyval
in
(
gtk
.
keysyms
.
Page_Up
,
gtk
.
keysyms
.
Page_Down
):
# CTRL + PageUp | PageDown
# CTRL + PageUp | PageDown
# Create event and send it to notebook
# Create event and send it to notebook
...
@@ -389,12 +398,14 @@ class MessageWindow(object):
...
@@ -389,12 +398,14 @@ class MessageWindow(object):
event
.
state
=
gtk
.
gdk
.
CONTROL_MASK
event
.
state
=
gtk
.
gdk
.
CONTROL_MASK
event
.
keyval
=
int
(
keyval
)
event
.
keyval
=
int
(
keyval
)
self
.
notebook
.
emit
(
'
key_press_event
'
,
event
)
self
.
notebook
.
emit
(
'
key_press_event
'
,
event
)
return
True
if
modifier
&
gtk
.
gdk
.
SHIFT_MASK
:
if
modifier
&
gtk
.
gdk
.
SHIFT_MASK
:
# CTRL + SHIFT
# CTRL + SHIFT
if
control
.
type_id
==
message_control
.
TYPE_GC
and
\
if
control
.
type_id
==
message_control
.
TYPE_GC
and
\
keyval
==
gtk
.
keysyms
.
n
:
# CTRL + SHIFT + n
keyval
==
gtk
.
keysyms
.
n
:
# CTRL + SHIFT + n
control
.
_on_change_nick_menuitem_activate
(
None
)
control
.
_on_change_nick_menuitem_activate
(
None
)
return
True
# MOD1 (ALT) mask
# MOD1 (ALT) mask
elif
modifier
&
gtk
.
gdk
.
MOD1_MASK
:
elif
modifier
&
gtk
.
gdk
.
MOD1_MASK
:
# Tab switch bindings
# Tab switch bindings
...
@@ -403,26 +414,34 @@ class MessageWindow(object):
...
@@ -403,26 +414,34 @@ class MessageWindow(object):
if
new
>=
self
.
notebook
.
get_n_pages
():
if
new
>=
self
.
notebook
.
get_n_pages
():
new
=
0
new
=
0
self
.
notebook
.
set_current_page
(
new
)
self
.
notebook
.
set_current_page
(
new
)
return
True
elif
keyval
==
gtk
.
keysyms
.
Left
:
# ALT + LEFT
elif
keyval
==
gtk
.
keysyms
.
Left
:
# ALT + LEFT
new
=
self
.
notebook
.
get_current_page
()
-
1
new
=
self
.
notebook
.
get_current_page
()
-
1
if
new
<
0
:
if
new
<
0
:
new
=
self
.
notebook
.
get_n_pages
()
-
1
new
=
self
.
notebook
.
get_n_pages
()
-
1
self
.
notebook
.
set_current_page
(
new
)
self
.
notebook
.
set_current_page
(
new
)
return
True
elif
chr
(
keyval
)
in
st
:
# ALT + 1,2,3..
elif
chr
(
keyval
)
in
st
:
# ALT + 1,2,3..
self
.
notebook
.
set_current_page
(
st
.
index
(
chr
(
keyval
)))
self
.
notebook
.
set_current_page
(
st
.
index
(
chr
(
keyval
)))
return
True
elif
keyval
==
gtk
.
keysyms
.
c
:
# ALT + C toggles chat buttons
elif
keyval
==
gtk
.
keysyms
.
c
:
# ALT + C toggles chat buttons
control
.
chat_buttons_set_visible
(
not
control
.
hide_chat_buttons
)
control
.
chat_buttons_set_visible
(
not
control
.
hide_chat_buttons
)
return
True
elif
keyval
==
gtk
.
keysyms
.
m
:
# ALT + M show emoticons menu
elif
keyval
==
gtk
.
keysyms
.
m
:
# ALT + M show emoticons menu
control
.
show_emoticons_menu
()
control
.
show_emoticons_menu
()
return
True
elif
keyval
==
gtk
.
keysyms
.
d
:
# ALT + D show actions menu
elif
keyval
==
gtk
.
keysyms
.
d
:
# ALT + D show actions menu
control
.
on_actions_button_clicked
(
control
.
actions_button
)
control
.
on_actions_button_clicked
(
control
.
actions_button
)
return
True
elif
control
.
type_id
==
message_control
.
TYPE_GC
and
\
elif
control
.
type_id
==
message_control
.
TYPE_GC
and
\
keyval
==
gtk
.
keysyms
.
t
:
# ALT + t
keyval
==
gtk
.
keysyms
.
t
:
# ALT + t
control
.
_on_change_subject_menuitem_activate
(
None
)
control
.
_on_change_subject_menuitem_activate
(
None
)
return
True
# Close tab bindings
# Close tab bindings
elif
keyval
==
gtk
.
keysyms
.
Escape
and
\
elif
keyval
==
gtk
.
keysyms
.
Escape
and
\
gajim
.
config
.
get
(
'
escape_key_closes
'
):
# Escape
gajim
.
config
.
get
(
'
escape_key_closes
'
):
# Escape
self
.
remove_tab
(
control
,
self
.
CLOSE_ESC
)
self
.
remove_tab
(
control
,
self
.
CLOSE_ESC
)
return
True
def
_on_close_button_clicked
(
self
,
button
,
control
):
def
_on_close_button_clicked
(
self
,
button
,
control
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment