Commit 757537fe authored by Sophie Herold's avatar Sophie Herold

Complete rebase

parent 19705971
Pipeline #2172 failed with stages
in 3 minutes and 5 seconds
......@@ -35,8 +35,6 @@ import logging
from gajim import gtkgui_helpers
from gajim import dataforms_widget
from gajim.gtk import ContactInfo
from random import randrange
from gajim.common import ged
from gajim.common.const import ACTIVITIES
......
......@@ -41,6 +41,7 @@ from gajim.common import ged
from gajim.common import configpaths
from gajim.common.i18n import Q_
from gajim.common.const import AvatarSize
from gajim.gtk.util import get_builder
# log = logging.getLogger('gajim.vcard')
......@@ -72,13 +73,13 @@ class ContactInfo:
'ADR_CTRY': _('Country'),
'DESC': _('About'),
# Not acutally vcard but gajim internal
'ROLE': Q_("?Role in Group Chat:Role"),
'GC_ROLE': Q_("?Role in Group Chat:Role"),
'AFFILIATION': _('Affiliation'),
}
def __init__(self, contact, account, gc_contact = None):
# the contact variable is the jid if vcard is true
self.ui = gtkgui_helpers.Ui('vcard_information_window.ui')
self.ui = get_builder('vcard_information_window.ui')
self.var_grid = InfoGrid(self.ui.var_grid)
self.client_grid = InfoGrid(self.ui.client_grid)
......@@ -136,7 +137,7 @@ class ContactInfo:
create_button.get_style_context().add_class('suggested-action')
self.ui.edit_group_window.set_default_response(2)
self.ui.builder.connect_signals(self)
self.ui.connect_signals(self)
self.ui.window.show_all()
def destroy(self):
......@@ -315,7 +316,7 @@ class ContactInfo:
self.var_grid.clear()
self.add_section(_('Group Chat'), [
('group_chat', 'ROLE'), ('group_chat', 'AFFILIATION'),
('group_chat', 'GC_ROLE'), ('group_chat', 'AFFILIATION'),
('group_chat', 'JABBERID')
])
self.add_section(_('Contact'), [
......@@ -525,7 +526,7 @@ class ContactInfo:
self.ui.jid_label.set_text(self.contact.jid)
if self.gc_contact:
self._add_to_vcard('group_chat', 'ROLE',
self._add_to_vcard('group_chat', 'GC_ROLE',
helpers.get_uf_role(self.gc_contact.role))
self._add_to_vcard('group_chat', 'AFFILIATION',
helpers.get_uf_affiliation(self.gc_contact.affiliation))
......
......@@ -151,16 +151,6 @@ def get_gtk_builder(file_name, widget=None):
builder.add_from_file(file_path)
return builder
class Ui:
def __init__(self, filename=None):
if filename:
self.builder = get_gtk_builder(filename)
else:
self.builder = Gtk.Builder()
def __getattr__(self, name):
return self.builder.get_object(name)
def get_completion_liststore(entry):
"""
Create a completion model for entry widget completion list consists of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment