Daniel Brötzmann pushed to branch newcontrol at gajim / gajim
Commits:
-
32cd853a
by wurstsalat at 2022-07-11T20:19:17+02:00
4 changed files:
- gajim/common/modules/httpupload.py
- gajim/gtk/accounts.py
- gajim/gtk/controls/base.py
- gajim/gtk/controls/chat.py
Changes:
| ... | ... | @@ -95,9 +95,6 @@ def pass_disco(self, info: DiscoInfo) -> None: |
| 95 | 95 | GLib.FormatSizeFlags.IEC_UNITS)
|
| 96 | 96 | self._log.info('Component has a maximum file size of: %s', size)
|
| 97 | 97 | |
| 98 | - for ctrl in app.window.get_controls(account=self._account):
|
|
| 99 | - ctrl.update_actions()
|
|
| 100 | - |
|
| 101 | 98 | def make_transfer(self,
|
| 102 | 99 | path: str,
|
| 103 | 100 | encryption: Optional[str],
|
| ... | ... | @@ -872,8 +872,6 @@ def _reset_send_read_marker(self, button: Gtk.Button) -> None: |
| 872 | 872 | app.settings.set_contact_settings('send_marker', None)
|
| 873 | 873 | app.settings.set_group_chat_settings(
|
| 874 | 874 | 'send_marker', None, context='private')
|
| 875 | - for ctrl in app.window.get_controls(account=self._account):
|
|
| 876 | - ctrl.update_actions()
|
|
| 877 | 875 | |
| 878 | 876 | |
| 879 | 877 | class ConnectionPage(GenericSettingPage):
|
| ... | ... | @@ -321,11 +321,6 @@ def is_groupchat(self) -> bool: |
| 321 | 321 | def focus(self) -> None:
|
| 322 | 322 | raise NotImplementedError
|
| 323 | 323 | |
| 324 | - def update_actions(self) -> None:
|
|
| 325 | - """
|
|
| 326 | - Derived types MAY implement this
|
|
| 327 | - """
|
|
| 328 | - |
|
| 329 | 324 | def update_ui(self) -> None:
|
| 330 | 325 | """
|
| 331 | 326 | Derived types SHOULD implement this
|
| ... | ... | @@ -40,12 +40,8 @@ |
| 40 | 40 | |
| 41 | 41 | from gajim.common import app
|
| 42 | 42 | from gajim.common import events
|
| 43 | -from gajim.common import helpers
|
|
| 44 | -from gajim.common import types
|
|
| 45 | -from gajim.common.client import Client
|
|
| 46 | 43 | from gajim.common.i18n import _
|
| 47 | 44 | from gajim.common.helpers import AdditionalDataDict
|
| 48 | -from gajim.common.const import SimpleClientState
|
|
| 49 | 45 | from gajim.common.const import KindConstant
|
| 50 | 46 | from gajim.common.modules.contacts import BareContact
|
| 51 | 47 | |
| ... | ... | @@ -81,16 +77,11 @@ def __init__(self, account: str, jid: JID) -> None: |
| 81 | 77 | self.correcting: bool = False
|
| 82 | 78 | self.last_sent_msg: Optional[str] = None
|
| 83 | 79 | |
| 84 | - if self._type == ControlType.CHAT:
|
|
| 85 | - self._client.connect_signal('state-changed',
|
|
| 86 | - self._on_client_state_changed)
|
|
| 87 | - |
|
| 88 | 80 | self.update_ui()
|
| 89 | 81 | |
| 90 | 82 | # PluginSystem: adding GUI extension point for this ChatControl
|
| 91 | 83 | # instance object
|
| 92 | 84 | app.plugin_manager.gui_extension_point('chat_control', self)
|
| 93 | - self.update_actions()
|
|
| 94 | 85 | |
| 95 | 86 | def _connect_contact_signals(self) -> None:
|
| 96 | 87 | pass
|
| ... | ... | @@ -205,7 +196,6 @@ def _nec_ping(self, event: events.ApplicationEvent): |
| 205 | 196 | |
| 206 | 197 | def update_ui(self) -> None:
|
| 207 | 198 | BaseControl.update_ui(self)
|
| 208 | - self.update_actions()
|
|
| 209 | 199 | |
| 210 | 200 | def add_message(self,
|
| 211 | 201 | text: str,
|
| ... | ... | @@ -267,12 +257,6 @@ def _on_drag_data_received(self, |
| 267 | 257 | # File drag and drop (handled in chat_control_base)
|
| 268 | 258 | self.drag_data_file_transfer(selection)
|
| 269 | 259 | |
| 270 | - def _on_client_state_changed(self,
|
|
| 271 | - _client: Client,
|
|
| 272 | - _signal_name: str,
|
|
| 273 | - state: SimpleClientState):
|
|
| 274 | - self.update_actions()
|
|
| 275 | - |
|
| 276 | 260 | def _on_presence_received(self, event: events.PresenceReceived) -> None:
|
| 277 | 261 | self.update_ui()
|
| 278 | 262 |