Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
6fc44b33 by wurstsalat at 2022-10-07T12:16:36+02:00
imprv: Features dialog: Simplify statements on Windows
- - - - -
1 changed file:
- gajim/gtk/features.py
Changes:
=====================================
gajim/gtk/features.py
=====================================
@@ -87,6 +87,10 @@ def _add_feature(self, feature: Feature) -> None:
self.feature_listbox.add(item)
def _get_features(self) -> list[Feature]:
+ tray_icon_available = bool(
+ sys.platform == 'win32' or
+ app.is_installed('APPINDICATOR') or
+ app.is_installed('AYATANA_APPINDICATOR'))
av_available = app.is_installed('AV') and sys.platform != 'win32'
notification_sounds_available: bool = (
app.is_installed('GSOUND') or sys.platform in ('win32', 'darwin'))
@@ -97,13 +101,11 @@ def _get_features(self) -> list[Feature]:
auto_status_enabled = bool(any(auto_status))
return [
- Feature(_('App Indicator Icon'),
- app.is_installed('APPINDICATOR') or
- app.is_installed('AYATANA_APPINDICATOR'),
- _('Enables Gajim to provide a system notification area '
- 'icon'),
+ Feature(_('Notification Area Icon'),
+ tray_icon_available,
+ _('Enables Gajim to provide a notification area icon'),
_('Requires: libappindicator3'),
- _('Feature not available under Windows'),
+ _('No additional requirements'),
None),
Feature(_('Audio / Video'),
av_available,
@@ -111,11 +113,11 @@ def _get_features(self) -> list[Feature]:
_('Requires: gir1.2-farstream-0.2, gir1.2-gstreamer-1.0, '
'gstreamer1.0-plugins-base, gstreamer1.0-plugins-ugly, '
'gstreamer1.0-libav, and gstreamer1.0-gtk3'),
- _('Feature not available under Windows'),
+ _('Feature not available on Windows'),
None),
Feature(_('Automatic Status'),
self._idle_available(),
- _("Enables Gajim to measure your computer's idle time in "
+ _('Enables Gajim to measure your computer’s idle time in '
'order to set your Status automatically'),
_('Requires: libxss'),
_('No additional requirements'),
@@ -131,22 +133,21 @@ def _get_features(self) -> list[Feature]:
_('Enables Gajim to store Passwords securely instead of '
'storing them in plaintext'),
_('Requires: gnome-keyring or kwallet'),
- _('Windows Credential Vault is used for secure password '
- 'storage'),
+ _('No additional requirements'),
app.settings.get('use_keyring')),
Feature(_('Spell Checker'),
app.is_installed('GSPELL'),
_('Enables Gajim to spell check your messages while '
'composing'),
_('Requires: Gspell'),
- _('Requires: Gspell'),
+ _('No additional requirements'),
spell_check_enabled),
Feature(_('UPnP-IGD Port Forwarding'),
app.is_installed('UPNP'),
_('Enables Gajim to request your router to forward ports '
'for file transfers'),
_('Requires: gir1.2-gupnpigd-1.0'),
- _('Feature not available under Windows'),
+ _('Feature not available on Windows'),
None)
]
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/6fc44b33203ac562a3b368a3e4f44b19…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/6fc44b33203ac562a3b368a3e4f44b19…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
37dca1cb by wurstsalat at 2022-10-06T16:55:49+02:00
refactor: Remove usage of app.connections in tests
- - - - -
1 changed file:
- test/no_gui/test_nick_completion.py
Changes:
=====================================
test/no_gui/test_nick_completion.py
=====================================
@@ -24,7 +24,7 @@ def test_generate_suggestions(self):
participant.name = name
participants.append(participant)
- app.connections = MagicMock()
+ app.get_client = MagicMock()
app.storage.archive = MagicMock()
app.storage.archive.get_recent_muc_nicks = MagicMock(
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/37dca1cb6eb5d5dd9f693c7cd93ac3f2…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/37dca1cb6eb5d5dd9f693c7cd93ac3f2…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
98beb62c by wurstsalat at 2022-10-05T23:42:56+02:00
cfix: Control: Don’t add call row for every jingle request type
- - - - -
1 changed file:
- gajim/gtk/control.py
Changes:
=====================================
gajim/gtk/control.py
=====================================
@@ -405,6 +405,10 @@ def _on_jingle_request_received(self,
if not self._is_event_processable(event):
return
+ if not any(item in ('audio', 'video') for item in event.contents):
+ # This is not a call
+ return
+
active_jid = app.call_manager.get_active_call_jid()
# Don't add a second row if contact upgrades to video
if active_jid is None:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/98beb62c9a86fb45a0d248fe9cfc8fe6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/98beb62c9a86fb45a0d248fe9cfc8fe6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
39628b6d by Philipp Hörist at 2022-10-05T22:59:05+02:00
new: Client: Add is_destroyed() method
- - - - -
adb5f1a2 by Philipp Hörist at 2022-10-05T22:59:05+02:00
refactor: MessageActionsBox: Check if client is already destroyed
- - - - -
b613e763 by Philipp Hörist at 2022-10-05T22:59:05+02:00
refactor: ConversationView: Move special row creation into switch_contact()
- - - - -
30071a1f by Philipp Hörist at 2022-10-05T22:59:05+02:00
cfix: VCardAvatars: Set task obsolete if we are not connected
- - - - -
126829fa by Philipp Hörist at 2022-10-05T22:59:05+02:00
cfix: Accounts: Execute disable_account() as late as possible
- - - - -
7a98a1f2 by Philipp Hörist at 2022-10-05T22:59:05+02:00
cfix: RemoveAccount: Execute remove_account() as late as possible
- - - - -
c71ca59b by Philipp Hörist at 2022-10-05T22:59:05+02:00
refactor: Client: Remove workaround when disabling account
We only call disable account when we are disconnected now.
- - - - -
6 changed files:
- gajim/common/client.py
- gajim/common/modules/vcard_avatars.py
- gajim/gtk/accounts.py
- gajim/gtk/conversation/view.py
- gajim/gtk/message_actions_box.py
- gajim/gtk/remove_account.py
Changes:
=====================================
gajim/common/client.py
=====================================
@@ -150,6 +150,9 @@ def local_address(self) -> Optional[str]:
return address.to_string().split(':')[0]
return None
+ def is_destroyed(self) -> bool:
+ return self._destroyed
+
def set_remove_account(self, value: bool) -> None:
# Used by the RemoveAccount Assistant to make the Client
# not react to any stream errors that happen while the
@@ -157,16 +160,6 @@ def set_remove_account(self, value: bool) -> None:
self._remove_account = value
def _create_client(self) -> None:
- if self._destroyed:
- # If we disable an account cleanup() is called and all
- # modules are unregistered. Because disable_account() does not wait
- # for the client to properly disconnect, handlers of the
- # nbxmpp.Client() are emitted after we called cleanup().
- # After nbxmpp.Client() disconnects and is destroyed we create a
- # new instance with this method but modules.get_handlers() fails
- # because modules are already unregistered.
- # TODO: Make this nicer
- return
log.info('Create new nbxmpp client')
self._client = NBXMPPClient(log_context=self._account)
self.connection = self._client
@@ -645,12 +638,7 @@ def cleanup(self) -> None:
Monitor.disconnect(self._idle_handler_id)
app.app.disconnect(self._screensaver_handler_id)
if self._client is not None:
- # cleanup() is called before nbmxpp.Client has disconnected,
- # when we disable the account. So we need to unregister
- # handlers here.
- # TODO: cleanup() should not be called before disconnect is finished
- for handler in modules.get_handlers(self):
- self._client.unregister_handler(handler)
+ self._client.destroy()
modules.unregister_modules(self)
def quit(self, kill_core: bool) -> None:
=====================================
gajim/common/modules/vcard_avatars.py
=====================================
@@ -257,9 +257,11 @@ def preconditions_met(self) -> bool:
try:
client = app.get_client(self._contact.account)
except Exception:
+ self.set_obsolete()
return False
if not client.state.is_available:
+ self.set_obsolete()
return False
if isinstance(self._contact, GroupchatParticipant):
=====================================
gajim/gtk/accounts.py
=====================================
@@ -545,13 +545,13 @@ def _on_disconnect(event: AccountDisconnected) -> None:
if event.account != account:
return
app.ged.remove_event_handler('account-disconnected',
- ged.CORE,
+ ged.POSTGUI,
_on_disconnect)
app.interface.disable_account(account)
def _disable() -> None:
app.ged.register_event_handler('account-disconnected',
- ged.CORE,
+ ged.POSTGUI,
_on_disconnect)
client = app.get_client(account)
client.change_status('offline', 'offline')
=====================================
gajim/gtk/conversation/view.py
=====================================
@@ -187,6 +187,12 @@ def switch_contact(self, contact: ChatContactT) -> None:
self._block_signals = True
self._reset()
+ self._read_marker_row = ReadMarkerRow(self._contact)
+ self._list_box.add(self._read_marker_row)
+
+ self._scroll_hint_row = ScrollHintRow(self._contact.account)
+ self._list_box.add(self._scroll_hint_row)
+
app.settings.disconnect_signals(self)
app.settings.connect_signal('print_join_left',
@@ -232,15 +238,6 @@ def _reset(self) -> None:
self._read_marker_row = None
self._scroll_hint_row = None
- if self._contact is not None:
- # These need to be present if ConversationView is reset
- # without switch_contact being invoked
- self._read_marker_row = ReadMarkerRow(self._contact)
- self._list_box.add(self._read_marker_row)
-
- self._scroll_hint_row = ScrollHintRow(self._contact.account)
- self._list_box.add(self._scroll_hint_row)
-
def reset(self) -> None:
assert self._contact is not None
self.switch_contact(self._contact)
=====================================
gajim/gtk/message_actions_box.py
=====================================
@@ -230,7 +230,7 @@ def switch_contact(self, contact: ChatContactT) -> None:
self._update_message_input_state()
def clear(self) -> None:
- if self._client is not None:
+ if self._client is not None and not self._client.is_destroyed():
self._set_chatstate(False)
self._client.disconnect_all_from_obj(self)
=====================================
gajim/gtk/remove_account.py
=====================================
@@ -69,8 +69,9 @@ def __init__(self, account: str) -> None:
self.connect('destroy', self._on_destroy)
self.register_events([
- ('account-connected', ged.GUI1, self._on_account_connected),
- ('account-disconnected', ged.GUI1, self._on_account_disconnected),
+ ('account-connected', ged.POSTGUI, self._on_account_connected),
+ ('account-disconnected', ged.POSTGUI,
+ self._on_account_disconnected),
])
self._set_remove_from_server_checkbox()
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/81365d4e8da0287213c7019716c7525…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/81365d4e8da0287213c7019716c7525…
You're receiving this email because of your account on dev.gajim.org.