Philipp Hörist pushed to branch master at gajim / gajim
Commits:
cbc7e8be by Andrey Gursky at 2020-09-06T10:36:55+02:00
ChatControlBase: Properly handle ENTER key if send_on_ctrl_enter is active
Fixes #10258
- - - - -
1 changed file:
- gajim/chat_control_base.py
Changes:
=====================================
gajim/chat_control_base.py
=====================================
@@ -894,6 +894,10 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if not app.settings.get('send_on_ctrl_enter'):
textview.insert_newline()
return True
+ else:
+ if app.settings.get('send_on_ctrl_enter'):
+ textview.insert_newline()
+ return True
if not app.account_is_available(self.account):
# we are not connected
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cbc7e8be076eb1200518af8cb8318aff…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cbc7e8be076eb1200518af8cb8318aff…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
56a68a26 by lovetox at 2020-09-05T17:30:06+02:00
Remove unused import
- - - - -
1 changed file:
- gajim/chat_control_base.py
Changes:
=====================================
gajim/chat_control_base.py
=====================================
@@ -55,7 +55,6 @@ from gajim.gtk.dialogs import DialogButton
from gajim.gtk.dialogs import NewConfirmationDialog
from gajim.gtk.dialogs import NewConfirmationCheckDialog
from gajim.gtk.message_input import MessageInputTextView
-from gajim.gtk import util
from gajim.gtk.util import at_the_end
from gajim.gtk.util import get_show_in_roster
from gajim.gtk.util import get_show_in_systray
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/56a68a26bd5856b6f1a0ce217ac566f6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/56a68a26bd5856b6f1a0ce217ac566f6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
f3287892 by lovetox at 2020-09-04T22:55:04+02:00
Settings: Add new value as a argument to signal callbacks
- - - - -
1 changed file:
- gajim/common/settings.py
Changes:
=====================================
gajim/common/settings.py
=====================================
@@ -96,7 +96,7 @@ class _Settings:
print('remove handler', handler)
handlers.remove(handler)
- def _notify(self, setting, account=None, jid=None):
+ def _notify(self, value, setting, account=None, jid=None):
log.info('Signal: %s changed', setting)
callbacks = self._callbacks[(setting, account, jid)]
@@ -105,7 +105,7 @@ class _Settings:
callbacks.remove(func)
continue
try:
- func()(setting, account, jid)
+ func()(value, setting, account, jid)
except Exception:
log.exception('Error while executing signal callback')
@@ -418,24 +418,24 @@ class _Settings:
if setting not in APP_SETTINGS:
raise ValueError(f'Invalid app setting: {setting}')
+ default = APP_SETTINGS[setting]
+ if not isinstance(value, type(default)) and value is not None:
+ raise TypeError(f'Invalid type for {setting}: '
+ f'{value} {type(value)}')
+
if value is None:
try:
del self._settings['app'][setting]
except KeyError:
pass
- self._notify(setting)
+ self._notify(default, setting)
return
- default = APP_SETTINGS[setting]
- if not isinstance(value, type(default)):
- raise TypeError(f'Invalid type for {setting}: '
- f'{value} {type(value)}')
-
self._settings['app'][setting] = value
self._commit_settings('app')
- self._notify(setting)
+ self._notify(value, setting)
set = set_app_setting
@@ -529,22 +529,24 @@ class _Settings:
if setting not in ACCOUNT_SETTINGS['account']:
raise ValueError(f'Invalid account setting: {setting}')
+ default = ACCOUNT_SETTINGS['account'][setting]
+ if not isinstance(value, type(default)) and value is not None:
+ raise TypeError(f'Invalid type for {setting}: '
+ f'{value} {type(value)}')
+
if value is None:
try:
del self._account_settings[account]['account'][setting]
except KeyError:
pass
- return
- default = ACCOUNT_SETTINGS['account'][setting]
- if not isinstance(value, type(default)):
- raise TypeError(f'Invalid type for {setting}: '
- f'{value} {type(value)}')
+ self._notify(default, setting, account)
+ return
self._account_settings[account]['account'][setting] = value
self._commit_account_settings(account)
- self._notify(setting, account)
+ self._notify(value, setting, account)
def get_group_chat_setting(self,
account: str,
@@ -582,13 +584,6 @@ class _Settings:
if setting not in ACCOUNT_SETTINGS['group_chat']:
raise ValueError(f'Invalid group chat setting: {setting}')
- if value is None:
- try:
- del self._account_settings[account]['group_chat'][setting]
- except KeyError:
- pass
- return
-
default = ACCOUNT_SETTINGS['group_chat'][setting]
if default is HAS_APP_DEFAULT:
if context is None:
@@ -596,10 +591,19 @@ class _Settings:
else:
default = APP_SETTINGS[f'gc_{setting}_{context}_default']
- if not isinstance(value, type(default)):
+ if not isinstance(value, type(default)) and value is not None:
raise TypeError(f'Invalid type for {setting}: '
f'{value} {type(value)}')
+ if value is None:
+ try:
+ del self._account_settings[account]['group_chat'][setting]
+ except KeyError:
+ pass
+
+ self._notify(default, setting, account, jid)
+ return
+
group_chat_settings = self._account_settings[account]['group_chat']
if jid not in group_chat_settings:
group_chat_settings[jid] = {setting: value}
@@ -607,7 +611,7 @@ class _Settings:
group_chat_settings[jid][setting] = value
self._commit_account_settings(account)
- self._notify(setting, account, jid)
+ self._notify(value, setting, account, jid)
def get_contact_setting(self,
account: str,
@@ -640,19 +644,21 @@ class _Settings:
if setting not in ACCOUNT_SETTINGS['contact']:
raise ValueError(f'Invalid contact setting: {setting}')
+ default = ACCOUNT_SETTINGS['contact'][setting]
+ if default is HAS_APP_DEFAULT:
+ default = APP_SETTINGS[f'{setting}_default']
+ if not isinstance(value, type(default)) and value is not None:
+ raise TypeError(f'Invalid type for {setting}: '
+ f'{value} {type(value)}')
+
if value is None:
try:
del self._account_settings[account]['contact'][setting]
except KeyError:
pass
- return
- default = ACCOUNT_SETTINGS['contact'][setting]
- if default is HAS_APP_DEFAULT:
- default = APP_SETTINGS[f'{setting}_default']
- if not isinstance(value, type(default)):
- raise TypeError(f'Invalid type for {setting}: '
- f'{value} {type(value)}')
+ self._notify(default, setting, account, jid)
+ return
contact_settings = self._account_settings[account]['contact']
if jid not in contact_settings:
@@ -661,7 +667,7 @@ class _Settings:
contact_settings[jid][setting] = value
self._commit_account_settings(account)
- self._notify(setting, account, jid)
+ self._notify(value, setting, account, jid)
def set_soundevent_setting(self,
event_name: str,
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f328789220f19abde2d9b201cec24811…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f328789220f19abde2d9b201cec24811…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
57782930 by lovetox at 2020-09-04T19:29:56+02:00
Settings: Add hints for translators
- - - - -
1 changed file:
- gajim/gtk/settings.py
Changes:
=====================================
gajim/gtk/settings.py
=====================================
@@ -757,7 +757,7 @@ class CutstomHostnameSetting(DialogSetting):
def get_setting_value(self):
custom = app.settings.get_account_setting(self.account, 'use_custom_host')
- return _('On') if custom else _('Off')
+ return Q_('?switch:On') if custom else Q_('?switch:Off')
class ChangePasswordSetting(DialogSetting):
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/57782930d8294a7c274a4f1621409ba0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/57782930d8294a7c274a4f1621409ba0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
b7bb36fb by lovetox at 2020-09-04T12:48:15+02:00
Chatstates: Don’t play message-sent sound when sending chatstate
Fixes #10245
- - - - -
3 changed files:
- gajim/common/modules/chatstates.py
- gajim/common/structs.py
- gajim/gui_interface.py
Changes:
=====================================
gajim/common/modules/chatstates.py
=====================================
@@ -317,7 +317,8 @@ class Chatstate(BaseModule):
contact=contact,
message=None,
type_=type_,
- chatstate=chatstate)
+ chatstate=chatstate,
+ play_sound=False)
self._con.send_message(message)
=====================================
gajim/common/structs.py
=====================================
@@ -63,7 +63,8 @@ class OutgoingMessage:
correct_id=None,
oob_url=None,
xhtml=None,
- nodes=None):
+ nodes=None,
+ play_sound=True):
if type_ not in ('chat', 'groupchat', 'normal', 'headline'):
raise ValueError('Unknown message type: %s' % type_)
@@ -108,6 +109,7 @@ class OutgoingMessage:
self.additional_data.set_value('gajim', 'xhtml', xhtml)
self.nodes = nodes
+ self.play_sound = play_sound
self.timestamp = None
self.message_id = None
=====================================
gajim/gui_interface.py
=====================================
@@ -245,9 +245,9 @@ class Interface:
@staticmethod
def handle_event_msgsent(obj):
- # ('MSGSENT', account, (jid, msg))
- # Do not play sound if it is a standalone chatstate message (eg no msg)
- # or if it is a message to more than one recipient
+ if not obj.play_sound:
+ return
+
enabled = app.settings.get_soundevent_settings('message_sent')['enabled']
if enabled:
if isinstance(obj.jid, list) and len(obj.jid) > 1:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b7bb36fbdc38e69e113aac6f06f03ab1…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b7bb36fbdc38e69e113aac6f06f03ab1…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
91086f37 by lovetox at 2020-09-03T23:41:17+02:00
ChatControl: Update actions when receiving caps
- - - - -
1 changed file:
- gajim/chat_control.py
Changes:
=====================================
gajim/chat_control.py
=====================================
@@ -839,6 +839,7 @@ class ChatControl(ChatControlBase):
ChatControlBase.update_ui(self)
self.update_toolbar()
self._update_avatar()
+ self.update_actions()
def draw_banner_text(self):
"""
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/91086f377784a395445ac6fae8509188…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/91086f377784a395445ac6fae8509188…
You're receiving this email because of your account on dev.gajim.org.