Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
3e546785 by wurstsalat at 2021-09-11T21:15:24+02:00
ServiceRegistration: Use window const
- - - - -
af774b00 by wurstsalat at 2021-09-11T21:24:20+02:00
Settings: Remove use_transports_iconsets
- - - - -
8 changed files:
- gajim/common/app.py
- gajim/common/setting_values.py
- gajim/gtk/add_contact.py
- gajim/gtk/const.py
- gajim/gtk/discovery.py
- gajim/gtk/preferences.py
- gajim/gtk/roster.py
- gajim/gtk/service_registration.py
Changes:
=====================================
gajim/common/app.py
=====================================
@@ -473,10 +473,12 @@ def get_transport_name_from_jid(jid,
use_config_setting=True):
If JID is not from transport returns None.
"""
+ # TODO: Rewrite/remove
+
#FIXME: jid can be None! one TB I saw had this problem:
# in the code block # it is a groupchat presence in handle_event_notify
# jid was None. Yann why?
- if not jid or (use_config_setting and not
config.get('use_transports_iconsets')):
+ if not jid:
return
host = get_server_from_jid(jid)
=====================================
gajim/common/setting_values.py
=====================================
@@ -33,7 +33,6 @@ class _ACCOUNT_DEFAULT:
'trayicon': 'always',
'allow_hide_roster': False,
'iconset': 'dcraven',
- 'use_transports_iconsets': True,
'collapsed_rows': '',
'roster_theme': 'default',
'sort_by_show_in_roster': True,
=====================================
gajim/gtk/add_contact.py
=====================================
@@ -30,7 +30,6 @@
from .assistant import Page
from .assistant import ErrorPage
from .groupchat_info import GroupChatInfoScrolled
-from .service_registration import ServiceRegistration
from .util import get_builder
from .util import open_window
@@ -439,7 +438,10 @@ def prepare(self, account, result):
_('This gateway does not support Ad-Hoc Commands.'))
def _on_register_clicked(self, _button):
- ServiceRegistration(self._account, self._result.jid)
+ open_window(
+ 'ServiceRegistration',
+ account=self._account,
+ address=self._result.jid)
def _on_command_clicked(self, _button):
AdHocCommand(self._account, self._result.jid)
=====================================
gajim/gtk/const.py
=====================================
@@ -135,4 +135,5 @@ def __str__(self):
'ContactInfo': 'gajim.gui.contact_info',
'WorkspaceDialog': 'gajim.gui.workspace_dialog',
'RosterItemExchange': 'gajim.gui.roster_item_exchange',
+ 'ServiceRegistration': 'gajim.gui.service_registration',
}
=====================================
gajim/gtk/discovery.py
=====================================
@@ -61,9 +61,9 @@
from .adhoc import AdHocCommand
from .dialogs import ErrorDialog
from .search import Search
-from .service_registration import ServiceRegistration
from .util import icon_exists
from .util import get_builder
+from .util import open_window
LABELS = {
1: _('This service has not yet responded with detailed information'),
@@ -1345,7 +1345,8 @@ def _on_register_button_clicked(self, widget=None):
return
jid = model[iter_][0]
if jid:
- ServiceRegistration(self.account, jid)
+ open_window(
+ 'ServiceRegistration', account=self.account, address=jid)
def _on_join_button_clicked(self, widget):
"""
=====================================
gajim/gtk/preferences.py
=====================================
@@ -758,13 +758,6 @@ def __init__(self, *args):
'iconset',
props={'entries': iconset_items},
callback=self._on_iconset_changed),
-
- Setting(SettingKind.SWITCH,
- _('Use Transport Icons'),
- SettingType.CONFIG,
- 'use_transports_iconsets',
- desc=_('Display protocol-specific status icons '
- '(ICQ, ..)')),
]
PreferenceBox.__init__(self, settings)
=====================================
gajim/gtk/roster.py
=====================================
@@ -24,9 +24,9 @@
from .dialogs import ConfirmationDialog
from .dialogs import DialogButton
from .tooltips import RosterTooltip
-from .service_registration import ServiceRegistration
from .util import EventHelper
from .util import get_builder
+from .util import open_window
log = logging.getLogger('gajim.gui.roster')
@@ -268,7 +268,10 @@ def _on_contact_info(self, _action, param):
app.window.contact_info(self._account, param.get_string())
def _on_modify_gateway(self, _action, param):
- ServiceRegistration(self._account, param.get_string())
+ open_window(
+ 'ServiceRegistration',
+ account=self._account,
+ address=param.get_string())
def _on_execute_command(self, _action, param):
app.window.execute_command(self._account, param.get_string())
=====================================
gajim/gtk/service_registration.py
=====================================
@@ -38,12 +38,12 @@ class Page(IntEnum):
class ServiceRegistration(Gtk.Assistant):
- def __init__(self, account, agent):
+ def __init__(self, account, address):
Gtk.Assistant.__init__(self)
+ self.account = account
self._con = app.connections[account]
- self._agent = agent
- self._account = account
+ self._agent = address
self._data_form_widget = None
self.set_application(app.app)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1f5d3999c6ed4628dd8497ba4e5b154259159f36...af774b00e4e20ab224193dedffe94391ced2f27c
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1f5d3999c6ed4628dd8497ba4e5b154259159f36...af774b00e4e20ab224193dedffe94391ced2f27c
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits