Philipp Hörist pushed to branch master at gajim / gajim
Commits:
cd9885c0 by Daniel Brötzmann at 2019-10-23T14:25:45Z
HistoryWindow: Close search results first
This checks if the search results scrolled window is visible when pressing
Esc. It will first hide the scrolled window, and only then close the
history window.
- - - - -
1 changed file:
- gajim/gtk/history.py
Changes:
=====================================
gajim/gtk/history.py
=====================================
@@ -276,6 +276,9 @@ class HistoryWindow(Gtk.ApplicationWindow):
def _on_key_press(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
+ if self._ui.results_scrolledwindow.get_visible():
+ self._ui.results_scrolledwindow.set_visible(False)
+ return
self.save_state()
self.destroy()
@@ -294,7 +297,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
def _jid_entry_search(self, jid):
self._load_history(jid, self.account)
- self._ui.results_scrolledwindow.set_property('visible', False)
+ self._ui.results_scrolledwindow.set_visible(False)
def _load_history(self, jid_or_name, account=None):
"""
@@ -373,7 +376,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
self._ui.button_first_day.set_sensitive(False)
self._ui.button_last_day.set_sensitive(False)
- self._ui.results_scrolledwindow.set_property('visible', False)
+ self._ui.results_scrolledwindow.set_visible(False)
def on_calendar_day_selected(self, widget):
if not self.jid:
@@ -650,10 +653,10 @@ class HistoryWindow(Gtk.ApplicationWindow):
self.history_buffer.remove_tag_by_name('highlight', start, end)
if text == '':
- self._ui.results_scrolledwindow.set_property('visible', False)
+ self._ui.results_scrolledwindow.set_visible(False)
return
- self._ui.results_scrolledwindow.set_property('visible', True)
+ self._ui.results_scrolledwindow.set_visible(True)
# perform search in preselected jids
# jids are preselected with the query_entry
@@ -804,7 +807,7 @@ class HistoryWindow(Gtk.ApplicationWindow):
# Only in that case because it's called by
# self._fill_completion_dict() otherwise
self._load_history(jid, account)
- self._ui.results_scrolledwindow.set_property('visible', False)
+ self._ui.results_scrolledwindow.set_visible(False)
def save_state(self):
x, y = self.get_window().get_root_origin()
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/cd9885c0a1b2c55fd3ede70a20f3f2c4d2…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/cd9885c0a1b2c55fd3ede70a20f3f2c4d2…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
39b4b8fc by Philipp Hörist at 2019-10-20T17:34:45Z
Remove Fuzzy Clock
I consider this feature bloat
- - - - -
19b2911b by Philipp Hörist at 2019-10-20T17:37:33Z
Rename method
show_receipt_icon() -> show_receipt()
- - - - -
8b6a1d1c by Philipp Hörist at 2019-10-20T19:54:36Z
Receipts: Simplify event code
- - - - -
fddcd2b3 by Philipp Hörist at 2019-10-20T19:55:43Z
Receipts: use build_receipt()
- - - - -
5 changed files:
- gajim/chat_control.py
- gajim/common/config.py
- − gajim/common/fuzzyclock.py
- gajim/common/modules/receipts.py
- gajim/conversation_textview.py
Changes:
=====================================
gajim/chat_control.py
=====================================
@@ -941,13 +941,9 @@ class ChatControl(ChatControlBase):
else:
self.old_msg_kind = kind
+ @event_filter(['account', 'jid'])
def _receipt_received(self, event):
- if event.conn.name != self.account:
- return
- if event.jid != self.contact.jid:
- return
-
- self.conv_textview.show_receipt_icon(event.receipt_id)
+ self.conv_textview.show_receipt(event.receipt_id)
def get_tab_label(self):
unread = ''
=====================================
gajim/common/config.py
=====================================
@@ -112,7 +112,6 @@ class Config:
'ignore_incoming_xhtml': [opt_bool, False, ],
'speller_language': [opt_str, '', _('Language used for spell checking.')],
'print_time': [opt_str, 'always', _('\'always\' - print time for every message.\n\'sometimes\' - print time every print_ichat_every_foo_minutes minute.\n\'never\' - never print time.')],
- 'print_time_fuzzy': [opt_int, 0, _('Print time in chats using Fuzzy Clock. Value of fuzziness from 1 to 4, or 0 to disable Fuzzy Clock. 1 is the most precise clock, 4 the least precise one. This is used only if \'print_time\' is \'sometimes\'.')],
'emoticons_theme': [opt_str, 'noto-emoticons', '', True],
'ascii_emoticons': [opt_bool, True, _('When enabled, ASCII emojis will be converted to graphical emojis.'), True],
'ascii_formatting': [opt_bool, True,
=====================================
gajim/common/fuzzyclock.py deleted
=====================================
@@ -1,95 +0,0 @@
-# Copyright (C) 2006 Christoph Neuroth <delmonico AT gmx.net>
-# Copyright (C) 2006-2014 Yann Leboulanger <asterix AT lagaule.org>
-# Copyright (C) 2007 Jean-Marie Traissard <jim AT lapin.org>
-# Copyright (C) 2009 Benjamin Richter <br AT waldteufel-online.net>
-#
-# This file is part of Gajim.
-#
-# Gajim is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published
-# by the Free Software Foundation; version 3 only.
-#
-# Gajim is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-Python class to show a "fuzzy clock".
-Homepage of the original: http://home.gna.org/fuzzyclock/
-Project Page of the original: http://gna.org/projects/fuzzyclock
-
-The class is based on a port from PHP code by
-Henrique Recidive <henrique at recidive.com> which was
-in turn based on the Fuzzy Clock Applet of Frerich Raabe (KDE).
-So most of the credit goes to this guys, thanks :-)
-"""
-
-from gajim.common.i18n import _
-
-
-class FuzzyClock:
- HOUR_NAMES = [
- _('twelve'), _('one'), _('two'), _('three'), _('four'),
- _('five'), _('six'), _('seven'), _('eight'), _('nine'), _('ten'),
- _('eleven')
- ]
-
- # Strings to use for the output. %(0)s will be replaced with
- # the preceding hour (e.g. "x PAST %(0)s"), %(1)s with the coming hour
- # (e.g. "x TO %(0)s")
- FUZZY_TIME = [
- _("%(0)s o'clock"),
- _('five past %(0)s'),
- _('ten past %(0)s'),
- _('quarter past %(0)s'),
- _('twenty past %(0)s'),
- _('twenty five past %(0)s'),
- _('half past %(0)s'),
- _('twenty five to %(1)s'),
- _('twenty to %(1)s'),
- _('quarter to %(1)s'),
- _('ten to %(1)s'),
- _('five to %(1)s'),
- _("%(1)s o'clock")
- ]
-
- FUZZY_DAYTIME = [
- _('Night'),
- _('Early morning'),
- _('Morning'),
- _('Almost noon'),
- _('Noon'),
- _('Afternoon'),
- _('Evening'),
- _('Late evening'),
- _('Night')
- ]
-
- FUZZY_WEEK = [
- _('Start of week'),
- _('Middle of week'),
- _('Middle of week'),
- _('Middle of week'),
- _('End of week'),
- _('Weekend!'),
- _('Weekend!')
- ]
-
- def fuzzy_time(self, fuzzyness, now):
- if fuzzyness in (1, 2):
- if fuzzyness == 1:
- sector = int(round(now.tm_min / 5.0))
- else:
- sector = int(round(now.tm_min / 15.0)) * 3
-
- return self.FUZZY_TIME[sector] % {
- '0': self.HOUR_NAMES[now.tm_hour % 12],
- '1': self.HOUR_NAMES[(now.tm_hour + 1) % 12]}
-
- if fuzzyness == 3:
- return self.FUZZY_DAYTIME[int(round(now.tm_hour / 3.0))]
- return self.FUZZY_WEEK[now.tm_wday]
=====================================
gajim/common/modules/receipts.py
=====================================
@@ -16,6 +16,7 @@
import nbxmpp
from nbxmpp.structs import StanzaHandler
+from nbxmpp.modules.receipts import build_receipt
from gajim.common import app
from gajim.common.nec import NetworkEvent
@@ -55,7 +56,7 @@ class Receipts(BaseModule):
if contact is None:
return
self._log.info('Send receipt: %s', properties.jid)
- self._con.connection.send(stanza.buildReceipt())
+ self._con.connection.send(build_receipt(stanza))
return
if properties.receipt.is_received:
@@ -65,13 +66,13 @@ class Receipts(BaseModule):
jid = properties.jid
if not properties.is_muc_pm:
- jid = properties.jid.getBare()
+ jid.setBare()
app.nec.push_incoming_event(
NetworkEvent('receipt-received',
- conn=self._con,
- receipt_id=properties.receipt.id,
- jid=jid))
+ account=self._account,
+ jid=jid,
+ receipt_id=properties.receipt.id))
raise nbxmpp.NodeProcessed
=====================================
gajim/conversation_textview.py
=====================================
@@ -41,7 +41,6 @@ from gajim.common import helpers
from gajim.common import i18n
from gajim.common.i18n import _
from gajim.common.helpers import AdditionalDataDict
-from gajim.common.fuzzyclock import FuzzyClock
from gajim.common.const import StyleAttr
from gajim.common.const import Trust
from gajim.common.helpers import to_user_string
@@ -188,7 +187,6 @@ class ConversationTextview(GObject.GObject):
self.line = 0
self._message_list = []
self.corrected_text_list = {}
- self.fc = FuzzyClock()
# no need to inherit TextView, use it as atrribute is safer
self.tv = HtmlTextView(account)
@@ -403,7 +401,7 @@ class ConversationTextview(GObject.GObject):
return index, end_mark, old_txt
- def show_receipt_icon(self, id_):
+ def show_receipt(self, id_):
line = self._get_message_line(id_)
if line is None:
return
@@ -1198,11 +1196,7 @@ class ConversationTextview(GObject.GObject):
seconds_passed = tim - self.last_time_printout
if seconds_passed > every_foo_seconds:
self.last_time_printout = tim
- if app.config.get('print_time_fuzzy') > 0:
- tim_format = self.fc.fuzzy_time(
- app.config.get('print_time_fuzzy'), local_tim)
- else:
- tim_format = self.get_time_to_show(local_tim, direction_mark)
+ tim_format = self.get_time_to_show(local_tim, direction_mark)
buffer_.insert_with_tags_by_name(iter_, tim_format + '\n',
'time_sometimes')
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/e5ac5e9bd20c6ad118b8ef67a24e054c9…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/e5ac5e9bd20c6ad118b8ef67a24e054c9…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9c431173 by Philipp Hörist at 2019-10-20T07:23:40Z
ConversationTextview: Reduce line height
- - - - -
1 changed file:
- gajim/conversation_textview.py
Changes:
=====================================
gajim/conversation_textview.py
=====================================
@@ -270,7 +270,7 @@ class ConversationTextview(GObject.GObject):
self.tagMarked.set_property('weight', Pango.Weight.BOLD)
textview_icon = buffer_.create_tag('textview-icon')
- textview_icon.set_property('rise', Pango.units_from_double(-4.45))
+ textview_icon.set_property('rise', Pango.units_from_double(-2.45))
tag = buffer_.create_tag('time_sometimes')
tag.set_property('foreground', 'darkgrey')
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9c431173c1b54aa7fcd7e5c1238dcadd4c…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9c431173c1b54aa7fcd7e5c1238dcadd4c…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
172725d1 by Philipp Hörist at 2019-10-19T13:51:20Z
Passwords: Improve log message in case of deletion error
Fixes #9865
- - - - -
1 changed file:
- gajim/common/passwords.py
Changes:
=====================================
gajim/common/passwords.py
=====================================
@@ -81,9 +81,11 @@ class SecretPasswordStorage(PasswordStorage):
log.info('Remove password from keyring')
try:
return self.keyring.delete_password('gajim', account_name)
+ except keyring.errors.PasswordDeleteError as error:
+ log.warning('Removing password failed: %s', error)
except Exception:
- log.exception('Remove password failed')
- return
+ log.exception('Removing password failed')
+
class PasswordStorageManager(PasswordStorage):
"""Access all the implemented password storage backends, knowing which ones
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/172725d18c5e0bea540605c7b1a8da047e…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/172725d18c5e0bea540605c7b1a8da047e…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0d7316be by Philipp Hörist at 2019-10-18T21:34:09Z
AccountCreation: Register plugin modules after successful registration
Fixes #9856
- - - - -
1 changed file:
- gajim/gtk/account_wizard.py
Changes:
=====================================
gajim/gtk/account_wizard.py
=====================================
@@ -293,7 +293,6 @@ class AccountCreationWizard:
100, self.update_progressbar)
# Get form from serveur
con = connection.Connection(self.account)
- app.plugin_manager.register_modules_for_account(con)
app.connections[self.account] = con
con.new_account(self.account, config)
elif cur_page == 3:
@@ -458,6 +457,10 @@ class AccountCreationWizard:
self.create_vars(obj.account_info)
self.show_finish_page()
+ # Register plugin modules after successful registration
+ # Some plugins need the registered JID to function properly
+ app.plugin_manager.register_modules_for_account(obj.conn)
+
if self.update_progressbar_timeout_id is not None:
GLib.source_remove(self.update_progressbar_timeout_id)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0d7316be2dfb447240af96df1f20df9e2c…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0d7316be2dfb447240af96df1f20df9e2c…
You're receiving this email because of your account on dev.gajim.org.