import time import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from nbxmpp.protocol import Iq from nbxmpp.modules.discovery import parse_disco_info from gajim.common.const import CSSPriority from gajim import gui gui.init('gtk') from test.gtk import util from gajim.gui.groupchat_info import GroupChatInfoScrolled util.load_style('gajim.css', CSSPriority.APPLICATION) stanza = Iq(node=''' http://jabber.org/protocol/muc#roominfo 1 ipsum dolor sit amet, consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt Lorem ipsum dolor sit amet, consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna userA@user.us userB@user.us 1 1 anyone de https://logs.xmpp.org/xsf/ ''') disco_info = parse_disco_info(stanza) class GroupchatInfo(Gtk.ApplicationWindow): def __init__(self): Gtk.ApplicationWindow.__init__(self) self.set_name('GroupchatJoin') self.set_position(Gtk.WindowPosition.CENTER) self.set_show_menubar(False) self.set_title('Test Group chat info') self._main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=18) self._main_box.set_valign(Gtk.Align.FILL) self._muc_info_box = GroupChatInfoScrolled(None) self._muc_info_box.set_vexpand(True) self._main_box.add(self._muc_info_box) self.add(self._main_box) self._muc_info_box.set_from_disco_info(disco_info) self._muc_info_box.set_subject( 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr sed ' 'diam nonumy eirmod tempor invidunt ut labore et dolore magna') self._muc_info_box.set_author('userX', None) self.show_all() win = GroupchatInfo() win.connect('destroy', Gtk.main_quit) win.show_all() Gtk.main()