Philipp Hörist pushed to branch master at gajim / gajim
Commits:
18a3258c by Tomasz MiÄ…sko at 2017-01-25T17:05:49+01:00
Fix inserting a newline on shift-enter.
Return false from key-press-event to propagate event to a default
handler that will insert a newline into the entry widget.
- - - - -
ffeeb8f9 by Tomasz MiÄ…sko at 2017-01-25T17:05:49+01:00
Simplify send or insert newline logic.
- - - - -
2e133d25 by Tomasz MiÄ…sko at 2017-01-25T17:05:49+01:00
Fix tab switching with ctrl+page up and ctrl+page down.
- - - - -
0b7d6cc1 by Tomasz MiÄ…sko at 2017-01-25T17:05:49+01:00
Fix moving between lines with up and down arrows.
- - - - -
b678165d by Tomasz MiÄ…sko at 2017-01-25T18:04:12+01:00
Use the same code path for shift-enter as for ctrl-enter.
- - - - -
b1940459 by Philipp Hörist at 2017-01-26T19:17:32+01:00
Merge branch 'fix-gtk3-shortcuts' into 'master'
Fix keyboard shortcuts in GTK3
See merge request !41
- - - - -
2 changed files:
- src/chat_control_base.py
- src/message_window.py
Changes:
=====================================
src/chat_control_base.py
=====================================
--- a/src/chat_control_base.py
+++ b/src/chat_control_base.py
@@ -668,49 +668,37 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self.scroll_messages('up', message_buffer, 'received')
else: # Ctrl+UP
self.scroll_messages('up', message_buffer, 'sent')
- return True
+ return True
elif event.keyval == Gdk.KEY_Down:
if event_state & Gdk.ModifierType.CONTROL_MASK:
if event_state & Gdk.ModifierType.SHIFT_MASK: # Ctrl+Shift+Down
self.scroll_messages('down', message_buffer, 'received')
else: # Ctrl+Down
self.scroll_messages('down', message_buffer, 'sent')
- return True
-
+ return True
elif event.keyval == Gdk.KEY_Return or \
event.keyval == Gdk.KEY_KP_Enter: # ENTER
- if event_state & Gdk.ModifierType.SHIFT_MASK:
- return True
message_textview = widget
message_buffer = message_textview.get_buffer()
start_iter, end_iter = message_buffer.get_bounds()
message = message_buffer.get_text(start_iter, end_iter, False)
xhtml = self.msg_textview.get_xhtml()
- if gajim.config.get('send_on_ctrl_enter'):
- if event_state & Gdk.ModifierType.CONTROL_MASK: # CTRL + ENTER
- send_message = True
- else:
- end_iter = message_buffer.get_end_iter()
- message_buffer.insert_at_cursor('\n')
- send_message = False
-
- else: # send on Enter, do newline on Ctrl Enter
- if event_state & Gdk.ModifierType.CONTROL_MASK: # Ctrl + ENTER
- end_iter = message_buffer.get_end_iter()
- message_buffer.insert_at_cursor('\n')
- send_message = False
- else: # ENTER
- send_message = True
-
- if gajim.connections[self.account].connected < 2 and send_message:
+ if event_state & Gdk.ModifierType.SHIFT_MASK:
+ send_message = False
+ else:
+ is_ctrl_enter = bool(event_state & Gdk.ModifierType.CONTROL_MASK)
+ send_message = is_ctrl_enter == gajim.config.get('send_on_ctrl_enter')
+
+ if send_message and gajim.connections[self.account].connected < 2:
# we are not connected
dialogs.ErrorDialog(_('A connection is not available'),
- _('Your message can not be sent until you are connected.'))
- send_message = False
+ _('Your message can not be sent until you are connected.'))
+ elif send_message:
+ self.send_message(message, xhtml=xhtml)
+ else:
+ message_buffer.insert_at_cursor('\n')
- if send_message:
- self.send_message(message, xhtml=xhtml) # send the message
return True
elif event.keyval == Gdk.KEY_z: # CTRL+z
if event_state & Gdk.ModifierType.CONTROL_MASK:
=====================================
src/message_window.py
=====================================
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -401,7 +401,7 @@ class MessageWindow(object):
elif keyval in (Gdk.KEY_Page_Up, Gdk.KEY_Page_Down):
# CTRL + PageUp | PageDown
# Create event and send it to notebook
- event = Gdk.Event(Gdk.EventType.KEY_PRESS)
+ event = Gdk.Event.new(Gdk.EventType.KEY_PRESS)
event.window = self.window.get_window()
event.time = int(time.time())
event.state = Gdk.ModifierType.CONTROL_MASK
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/179777239e17ae9917051e8ab218c4d48…
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
7d39b384 by Markus Böhme at 2017-01-25T10:46:31+01:00
Highlight all paragraphs of a search result in the history window
A single message may span multiple paragraphs. Highlight all lines
belonging to the paragraph containing the search keyword.
When filling the history textbuffer, tag each newline character that
is ending a message with an invisible tag. Then at search time
highlight all lines up to that tag.
- - - - -
b2e41e93 by Markus Böhme at 2017-01-25T10:48:33+01:00
Remove unnecessary code in message highlighting in the history window
The message to be highlighted is searched via an already formatted
timestamp, and the match contains the whole timestamp with any
preceding characters (like "["). Therefore, calling backward_char on
the start iterator of the match just goes back to the previous line
and is not needed.
- - - - -
27618b2d by Philipp Hörist at 2017-01-26T19:17:06+01:00
Merge branch 'gajim_0.16' into 'gajim_0.16'
History window: Highlight all paragraphs of a search result
See merge request !31
- - - - -
1 changed file:
- src/history_window.py
Changes:
=====================================
src/history_window.py
=====================================
--- a/src/history_window.py
+++ b/src/history_window.py
@@ -75,6 +75,8 @@ class HistoryWindow:
self.history_buffer = self.history_textview.tv.get_buffer()
self.history_buffer.create_tag('highlight', background = 'yellow')
self.history_buffer.create_tag('invisible', invisible=True)
+ self.eom_tag = self.history_buffer.create_tag('endofmessage',
+ invisible=True)
self.checkbutton = xml.get_object('log_history_checkbutton')
self.checkbutton.connect('toggled',
self.on_log_history_checkbutton_toggled)
@@ -515,7 +517,7 @@ class HistoryWindow:
else:
self.history_textview.print_real_text(message, name=contact_name,
xhtml=xhtml)
- self.history_textview.print_real_text('\n')
+ self.history_textview.print_real_text('\n', ['endofmessage'])
def on_query_entry_activate(self, widget):
text = self.query_entry.get_text()
@@ -624,13 +626,10 @@ class HistoryWindow:
self.calendar.select_day(day)
unix_time = model[path][C_TIME]
self._scroll_to_result(unix_time)
- #FIXME: one day do not search just for unix_time but the whole and user
- # specific format of the textbuffer line [time] nick: message
- # and highlight all that
def _scroll_to_result(self, unix_time):
"""
- Scroll to the result using unix_time and highlight line
+ Scroll to the result using unix_time and highlight message
"""
start_iter = self.history_buffer.get_start_iter()
local_time = time.localtime(float(unix_time))
@@ -641,9 +640,9 @@ class HistoryWindow:
None)
if result is not None:
match_start_iter, match_end_iter = result
- # include '[' or other character before time
- match_start_iter.backward_char()
- match_end_iter.forward_line() # highlight all message not just time
+ while not match_end_iter.has_tag(self.eom_tag):
+ if not match_end_iter.forward_to_line_end():
+ break
self.history_buffer.apply_tag_by_name('highlight', match_start_iter,
match_end_iter)
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/32085e8bd7b92d37b5cab52d59b77e54f…
Yann Leboulanger pushed to branch gajim_0.16 at gajim / gajim
Commits:
32085e8b by Yann Leboulanger at 2017-01-25T14:07:14+00:00
update po files
- - - - -
4 changed files:
- po/bg.po
- po/da.po
- po/de.po
- po/el.po
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/32085e8bd7b92d37b5cab52d59b77e54f4…
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
17977723 by Philipp Hörist at 2017-01-24T19:04:44+01:00
Update README.md
- - - - -
1 changed file:
- README.md
Changes:
=====================================
README.md
=====================================
--- a/README.md
+++ b/README.md
@@ -18,6 +18,6 @@ The goal of Gajim is to provide a full featured and easy to use Jabber/XMPP clie
- Latest release:
* [Gajim 0.16.6 (.tar.gz)](https://www.gajim.org/downloads/0.16/gajim-0.16.6.tar.gz)
* [Gajim 0.16.6-1 (.exe)](https://www.gajim.org/downloads/0.16/gajim-0.16.6-1.exe)
- * [Daily snapshot (.tar.gz)](https://www.gajim.org/downloads/snap/?M=D)
+ * [Daily snapshot](https://www.gajim.org/downloads/snap/?M=D)
- [Bug reports and Feature requests](https://dev.gajim.org/gajim/gajim/issues)
\ No newline at end of file
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/179777239e17ae9917051e8ab218c4d489…
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0dce40bb by Tomasz MiÄ…sko at 2017-01-24T15:29:15+01:00
Fix history scrolling in gtk3 #8481.
* Delay scrolling using GLib.idle_add. According to the GTK
documentation the scroll_to_mark should be doing this internally
already, but it is not the case.
* Center highlighted message vertically.
- - - - -
d2cfa9bb by Philipp Hörist at 2017-01-24T16:24:32+01:00
Merge branch 'history-scrolling' into 'master'
Fix history scrolling in gtk3 #8481.
See merge request !39
- - - - -
1 changed file:
- src/history_window.py
Changes:
=====================================
src/history_window.py
=====================================
--- a/src/history_window.py
+++ b/src/history_window.py
@@ -622,10 +622,9 @@ class HistoryWindow:
match_end_iter.forward_line() # highlight all message not just time
self.history_buffer.apply_tag_by_name('highlight', match_start_iter,
match_end_iter)
-
- match_start_mark = self.history_buffer.create_mark('match_start',
- match_start_iter, True)
- self.history_textview.tv.scroll_to_mark(match_start_mark, 0, True)
+ mark = self.history_buffer.create_mark('match', match_start_iter, True)
+ GLib.idle_add(self.history_textview.tv.scroll_to_mark, mark,
+ 0, True, 0.0, 0.5)
def on_log_history_checkbutton_toggled(self, widget):
# log conversation history?
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/a779066a61b29e22a67139eab5bcf9996…