Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
-
9544d729
by wurstsalat at 2021-11-01T19:58:59+01:00
-
febe5721
by wurstsalat at 2021-11-01T22:26:30+01:00
-
ad5cf996
by wurstsalat at 2021-11-01T23:00:25+01:00
9 changed files:
- gajim/data/style/default.css
- gajim/data/style/gajim.css
- gajim/gtk/call_widget.py
- gajim/gtk/chat_list.py
- gajim/gtk/chat_list_stack.py
- gajim/gtk/controls/chat.py
- gajim/gtk/conversation/rows/call.py
- gajim/gtk/conversation/rows/file_transfer_jingle.py
- gajim/gtk/conversation/view.py
Changes:
| ... | ... | @@ -16,8 +16,8 @@ .gajim-subject-message { |
| 16 | 16 |
background: rgb(225, 235, 250);
|
| 17 | 17 |
}
|
| 18 | 18 |
.gajim-call-message {
|
| 19 |
- color: rgb(40, 70, 100);
|
|
| 20 |
- background: rgb(225, 235, 250);
|
|
| 19 |
+ color: rgb(70, 70, 70);
|
|
| 20 |
+ background: rgb(230, 230, 230);
|
|
| 21 | 21 |
}
|
| 22 | 22 |
.gajim-command-error {
|
| 23 | 23 |
background-color: rgb(10, 50, 70);
|
| ... | ... | @@ -86,6 +86,9 @@ .conversation-call-box { |
| 86 | 86 |
border-radius: 6px;
|
| 87 | 87 |
padding: 12px;
|
| 88 | 88 |
}
|
| 89 |
+.conversation-call-box label {
|
|
| 90 |
+ font-size: small;
|
|
| 91 |
+}
|
|
| 89 | 92 |
.conversation-meta {
|
| 90 | 93 |
color: @insensitive_fg_color;
|
| 91 | 94 |
font-size: small;
|
| ... | ... | @@ -309,7 +309,7 @@ def accept_call(self, session): |
| 309 | 309 |
if video is not None:
|
| 310 | 310 |
session.approve_content('video')
|
| 311 | 311 |
|
| 312 |
- def reject_call(self, session):
|
|
| 312 |
+ def decline_call(self, session):
|
|
| 313 | 313 |
if not session:
|
| 314 | 314 |
return
|
| 315 | 315 |
|
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 |
import logging
|
| 16 | 16 |
import time
|
| 17 | 17 |
|
| 18 |
+from gi.repository import Gio
|
|
| 18 | 19 |
from gi.repository import Gdk
|
| 19 | 20 |
from gi.repository import GLib
|
| 20 | 21 |
from gi.repository import Gtk
|
| ... | ... | @@ -319,6 +320,10 @@ def process_event(self, event): |
| 319 | 320 |
self._on_presence_received(event)
|
| 320 | 321 |
elif event.name == 'message-sent':
|
| 321 | 322 |
self._on_message_sent(event)
|
| 323 |
+ elif event.name == 'jingle-request-received':
|
|
| 324 |
+ self._on_jingle_request_received(event)
|
|
| 325 |
+ elif event.name == 'file-request-received':
|
|
| 326 |
+ self._on_file_request_received(event)
|
|
| 322 | 327 |
else:
|
| 323 | 328 |
log.warning('Unhandled Event: %s', event.name)
|
| 324 | 329 |
|
| ... | ... | @@ -332,7 +337,8 @@ def _on_message_received(self, event): |
| 332 | 337 |
row.set_timestamp(event.properties.mam.timestamp)
|
| 333 | 338 |
else:
|
| 334 | 339 |
row.set_timestamp(event.properties.timestamp)
|
| 335 |
- row.set_message_text(event.msgtxt, event.additional_data)
|
|
| 340 |
+ row.set_message_text(
|
|
| 341 |
+ event.msgtxt, additional_data=event.additional_data)
|
|
| 336 | 342 |
self._add_unread(row, event.properties)
|
| 337 | 343 |
self.invalidate_sort()
|
| 338 | 344 |
|
| ... | ... | @@ -353,7 +359,8 @@ def _on_message_sent(self, event): |
| 353 | 359 |
|
| 354 | 360 |
# Set timestamp if it's None (outgoing MUC messages)
|
| 355 | 361 |
row.set_timestamp(event.timestamp or time.time())
|
| 356 |
- row.set_message_text(event.message, event.additional_data)
|
|
| 362 |
+ row.set_message_text(
|
|
| 363 |
+ event.message, additional_data=event.additional_data)
|
|
| 357 | 364 |
self.invalidate_sort()
|
| 358 | 365 |
|
| 359 | 366 |
@staticmethod
|
| ... | ... | @@ -376,6 +383,25 @@ def _on_presence_received(self, event): |
| 376 | 383 |
row = self._chats.get((event.account, event.jid))
|
| 377 | 384 |
row.update_avatar()
|
| 378 | 385 |
|
| 386 |
+ def _on_jingle_request_received(self, event):
|
|
| 387 |
+ content_types = []
|
|
| 388 |
+ for item in event.contents:
|
|
| 389 |
+ content_types.append(item.media)
|
|
| 390 |
+ if 'audio' in content_types or 'video' in content_types:
|
|
| 391 |
+ # AV Call received
|
|
| 392 |
+ row = self._chats.get((event.account, event.jid))
|
|
| 393 |
+ row.set_timestamp(time.time())
|
|
| 394 |
+ row.set_nick('')
|
|
| 395 |
+ row.set_message_text(
|
|
| 396 |
+ _('Call'), icon_name='call-start-symbolic')
|
|
| 397 |
+ |
|
| 398 |
+ def _on_file_request_received(self, event):
|
|
| 399 |
+ row = self._chats.get((event.account, event.jid))
|
|
| 400 |
+ row.set_timestamp(time.time())
|
|
| 401 |
+ row.set_nick('')
|
|
| 402 |
+ row.set_message_text(
|
|
| 403 |
+ _('File'), icon_name='text-x-generic-symbolic')
|
|
| 404 |
+ |
|
| 379 | 405 |
@staticmethod
|
| 380 | 406 |
def _add_unread(row, properties):
|
| 381 | 407 |
if properties.is_carbon_message and properties.carbon.is_sent:
|
| ... | ... | @@ -445,7 +471,8 @@ def __init__(self, workspace_id, account, jid, type_, pinned): |
| 445 | 471 |
return
|
| 446 | 472 |
|
| 447 | 473 |
if line.message is not None:
|
| 448 |
- self.set_message_text(line.message, line.additional_data)
|
|
| 474 |
+ self.set_message_text(
|
|
| 475 |
+ line.message, additional_data=line.additional_data)
|
|
| 449 | 476 |
if line.kind in (KindConstant.CHAT_MSG_SENT,
|
| 450 | 477 |
KindConstant.SINGLE_MSG_SENT):
|
| 451 | 478 |
self._ui.nick_label.set_text(_('Me:'))
|
| ... | ... | @@ -466,14 +493,16 @@ def __init__(self, workspace_id, account, jid, type_, pinned): |
| 466 | 493 |
|
| 467 | 494 |
if line.kind in (KindConstant.FILE_TRANSFER_INCOMING,
|
| 468 | 495 |
KindConstant.FILE_TRANSFER_OUTGOING):
|
| 469 |
- self._ui.message_label.set_text(_('File Transfer'))
|
|
| 496 |
+ self.set_message_text(
|
|
| 497 |
+ _('File'), icon_name='text-x-generic-symbolic')
|
|
| 470 | 498 |
self.timestamp = line.time
|
| 471 | 499 |
uf_timestamp = get_uf_relative_time(line.time)
|
| 472 | 500 |
self._ui.timestamp_label.set_text(uf_timestamp)
|
| 473 | 501 |
|
| 474 | 502 |
if line.kind in (KindConstant.CALL_INCOMING,
|
| 475 | 503 |
KindConstant.CALL_OUTGOING):
|
| 476 |
- self._ui.message_label.set_text(_('Call'))
|
|
| 504 |
+ self.set_message_text(
|
|
| 505 |
+ _('Call'), icon_name='call-start-symbolic')
|
|
| 477 | 506 |
self.timestamp = line.time
|
| 478 | 507 |
uf_timestamp = get_uf_relative_time(line.time)
|
| 479 | 508 |
self._ui.timestamp_label.set_text(uf_timestamp)
|
| ... | ... | @@ -629,14 +658,18 @@ def set_nick(self, nickname): |
| 629 | 658 |
self._ui.nick_label.set_visible(bool(nickname))
|
| 630 | 659 |
self._ui.nick_label.set_text(nickname)
|
| 631 | 660 |
|
| 632 |
- def set_message_text(self, text, additional_data):
|
|
| 661 |
+ def set_message_text(self, text, icon_name=None, additional_data=None):
|
|
| 633 | 662 |
icon = None
|
| 634 |
- if app.interface.preview_manager.get_previewable(text, additional_data):
|
|
| 635 |
- file_name = filename_from_uri(text)
|
|
| 636 |
- icon, file_type = guess_simple_file_type(text)
|
|
| 637 |
- text = '%(file_type)s (%(file_name)s)' % {
|
|
| 638 |
- 'file_type': file_type,
|
|
| 639 |
- 'file_name': file_name}
|
|
| 663 |
+ if icon_name is not None:
|
|
| 664 |
+ icon = Gio.Icon.new_for_string(icon_name)
|
|
| 665 |
+ if additional_data is not None:
|
|
| 666 |
+ if app.interface.preview_manager.get_previewable(
|
|
| 667 |
+ text, additional_data):
|
|
| 668 |
+ file_name = filename_from_uri(text)
|
|
| 669 |
+ icon, file_type = guess_simple_file_type(text)
|
|
| 670 |
+ text = '%(file_type)s (%(file_name)s)' % {
|
|
| 671 |
+ 'file_type': file_type,
|
|
| 672 |
+ 'file_name': file_name}
|
|
| 640 | 673 |
else:
|
| 641 | 674 |
text = text.replace('\n', ' ')
|
| 642 | 675 |
self._ui.message_label.set_text(text)
|
| ... | ... | @@ -31,6 +31,8 @@ |
| 31 | 31 |
'presence-received',
|
| 32 | 32 |
'message-sent',
|
| 33 | 33 |
'chatstate-received',
|
| 34 |
+ 'jingle-request-received',
|
|
| 35 |
+ 'file-request-received'
|
|
| 34 | 36 |
]
|
| 35 | 37 |
|
| 36 | 38 |
|
| ... | ... | @@ -106,7 +106,7 @@ def __init__(self, account, jid): |
| 106 | 106 |
self.xml.paned1.add2(self._call_widget)
|
| 107 | 107 |
|
| 108 | 108 |
self.conversation_view.connect('accept-call', self._on_accept_call)
|
| 109 |
- self.conversation_view.connect('reject-call', self._on_reject_call)
|
|
| 109 |
+ self.conversation_view.connect('decline-call', self._on_decline_call)
|
|
| 110 | 110 |
|
| 111 | 111 |
# Menu for the HeaderBar
|
| 112 | 112 |
self.control_menu = gui_menu_builder.get_singlechat_menu(
|
| ... | ... | @@ -491,8 +491,8 @@ def _process_jingle_av_event(self, event): |
| 491 | 491 |
def _on_accept_call(self, _view, session):
|
| 492 | 492 |
self._call_widget.accept_call(session)
|
| 493 | 493 |
|
| 494 |
- def _on_reject_call(self, _view, session):
|
|
| 495 |
- self._call_widget.reject_call(session)
|
|
| 494 |
+ def _on_decline_call(self, _view, session):
|
|
| 495 |
+ self._call_widget.decline_call(session)
|
|
| 496 | 496 |
|
| 497 | 497 |
def _on_call_ended(self, _call_widget):
|
| 498 | 498 |
self.conversation_view.update_call_rows()
|
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 |
|
| 20 | 20 |
from gajim.common import app
|
| 21 | 21 |
from gajim.common.const import AvatarSize
|
| 22 |
+from gajim.common.const import KindConstant
|
|
| 22 | 23 |
from gajim.common.i18n import _
|
| 23 | 24 |
|
| 24 | 25 |
from .widgets import SimpleLabel
|
| ... | ... | @@ -44,6 +45,7 @@ def __init__(self, account, contact, event=None, db_message=None): |
| 44 | 45 |
|
| 45 | 46 |
self._contact = contact
|
| 46 | 47 |
self._event = event
|
| 48 |
+ self._db_message = db_message
|
|
| 47 | 49 |
self._session = None
|
| 48 | 50 |
|
| 49 | 51 |
if is_from_db:
|
| ... | ... | @@ -51,21 +53,14 @@ def __init__(self, account, contact, event=None, db_message=None): |
| 51 | 53 |
module = self._client.get_module('Jingle')
|
| 52 | 54 |
self._session = module.get_jingle_session(self._contact.jid, sid)
|
| 53 | 55 |
|
| 54 |
- avatar_placeholder = Gtk.Box()
|
|
| 55 |
- avatar_placeholder.set_size_request(AvatarSize.ROSTER, -1)
|
|
| 56 |
- self.grid.attach(avatar_placeholder, 0, 0, 1, 1)
|
|
| 56 |
+ self._avatar_placeholder = Gtk.Box()
|
|
| 57 |
+ self._avatar_placeholder.set_size_request(AvatarSize.ROSTER, -1)
|
|
| 58 |
+ self.grid.attach(self._avatar_placeholder, 0, 0, 1, 1)
|
|
| 57 | 59 |
|
| 58 | 60 |
if event is None and self._session is None:
|
| 59 |
- icon = Gtk.Image.new_from_icon_name('call-start-symbolic',
|
|
| 60 |
- Gtk.IconSize.MENU)
|
|
| 61 |
- self.grid.attach(icon, 1, 0, 1, 1)
|
|
| 62 |
- |
|
| 63 |
- label = SimpleLabel()
|
|
| 64 |
- label.get_style_context().add_class('dim-label')
|
|
| 65 |
- label.set_text(_('Call'))
|
|
| 66 |
- self.grid.attach(label, 2, 0, 1, 1)
|
|
| 61 |
+ self._add_history_call_widget()
|
|
| 67 | 62 |
else:
|
| 68 |
- self._prepare_incoming_call()
|
|
| 63 |
+ self._add_incoming_call_widget()
|
|
| 69 | 64 |
|
| 70 | 65 |
timestamp_widget = self.create_timestamp_widget(self.timestamp)
|
| 71 | 66 |
timestamp_widget.set_hexpand(True)
|
| ... | ... | @@ -80,22 +75,14 @@ def update(self): |
| 80 | 75 |
return
|
| 81 | 76 |
|
| 82 | 77 |
self._call_box.destroy()
|
| 78 |
+ self._add_history_call_widget()
|
|
| 83 | 79 |
|
| 84 |
- icon = Gtk.Image.new_from_icon_name('call-start-symbolic',
|
|
| 85 |
- Gtk.IconSize.MENU)
|
|
| 86 |
- self.grid.attach(icon, 1, 0, 1, 1)
|
|
| 87 |
- |
|
| 88 |
- label = SimpleLabel()
|
|
| 89 |
- label.get_style_context().add_class('dim-label')
|
|
| 90 |
- label.set_text(_('Call'))
|
|
| 91 |
- self.grid.attach(label, 2, 0, 1, 1)
|
|
| 92 |
- self.show_all()
|
|
| 93 | 80 |
self._event = None
|
| 94 | 81 |
self._session = None
|
| 95 | 82 |
|
| 96 | 83 |
def _on_accept(self, button):
|
| 97 | 84 |
button.set_sensitive(False)
|
| 98 |
- self._reject_button.set_sensitive(False)
|
|
| 85 |
+ self._decline_button.set_sensitive(False)
|
|
| 99 | 86 |
if self._event is not None:
|
| 100 | 87 |
session = self._client.get_module('Jingle').get_jingle_session(
|
| 101 | 88 |
self._event.fjid, self._event.sid)
|
| ... | ... | @@ -103,18 +90,58 @@ def _on_accept(self, button): |
| 103 | 90 |
else:
|
| 104 | 91 |
self.get_parent().accept_call(self._session)
|
| 105 | 92 |
|
| 106 |
- def _on_reject(self, button):
|
|
| 107 |
- button.set_sensitive(False)
|
|
| 108 |
- self._accept_button.set_sensitive(False)
|
|
| 93 |
+ def _on_decline(self, button):
|
|
| 109 | 94 |
if self._event is not None:
|
| 110 | 95 |
session = self._client.get_module('Jingle').get_jingle_session(
|
| 111 | 96 |
self._event.fjid, self._event.sid)
|
| 112 |
- self.get_parent().reject_call(session)
|
|
| 97 |
+ self.get_parent().decline_call(session)
|
|
| 113 | 98 |
else:
|
| 114 |
- self.get_parent().reject_call(self._session)
|
|
| 99 |
+ self.get_parent().decline_call(self._session)
|
|
| 115 | 100 |
self._session = None
|
| 116 | 101 |
|
| 117 |
- def _prepare_incoming_call(self):
|
|
| 102 |
+ def _add_history_call_widget(self):
|
|
| 103 |
+ if self._db_message is not None:
|
|
| 104 |
+ if self._db_message.kind == KindConstant.CALL_INCOMING:
|
|
| 105 |
+ contact = self._contact
|
|
| 106 |
+ is_self = True
|
|
| 107 |
+ else:
|
|
| 108 |
+ contact = self._client.get_module('Contacts').get_contact(
|
|
| 109 |
+ str(self._client.get_own_jid().bare))
|
|
| 110 |
+ is_self = False
|
|
| 111 |
+ |
|
| 112 |
+ if self._event is not None:
|
|
| 113 |
+ if self._event == 'incoming-call':
|
|
| 114 |
+ contact = self._client.get_module('Contacts').get_contact(
|
|
| 115 |
+ str(self._client.get_own_jid().bare))
|
|
| 116 |
+ is_self = False
|
|
| 117 |
+ else:
|
|
| 118 |
+ contact = self._contact
|
|
| 119 |
+ is_self = True
|
|
| 120 |
+ |
|
| 121 |
+ scale = self.get_scale_factor()
|
|
| 122 |
+ avatar = contact.get_avatar(AvatarSize.ROSTER, scale, add_show=False)
|
|
| 123 |
+ avatar_image = Gtk.Image.new_from_surface(avatar)
|
|
| 124 |
+ self._avatar_placeholder.add(avatar_image)
|
|
| 125 |
+ |
|
| 126 |
+ name_widget = self.create_name_widget(contact.name, is_self)
|
|
| 127 |
+ name_widget.set_halign(Gtk.Align.START)
|
|
| 128 |
+ name_widget.set_valign(Gtk.Align.START)
|
|
| 129 |
+ self.grid.attach(name_widget, 1, 0, 1, 1)
|
|
| 130 |
+ |
|
| 131 |
+ icon = Gtk.Image.new_from_icon_name('call-start-symbolic',
|
|
| 132 |
+ Gtk.IconSize.MENU)
|
|
| 133 |
+ |
|
| 134 |
+ label = SimpleLabel()
|
|
| 135 |
+ label.get_style_context().add_class('dim-label')
|
|
| 136 |
+ label.set_text(_('Call'))
|
|
| 137 |
+ |
|
| 138 |
+ content_box = Gtk.Box(spacing=12)
|
|
| 139 |
+ content_box.add(icon)
|
|
| 140 |
+ content_box.add(label)
|
|
| 141 |
+ self.grid.attach(content_box, 1, 1, 1, 1)
|
|
| 142 |
+ self.show_all()
|
|
| 143 |
+ |
|
| 144 |
+ def _add_incoming_call_widget(self):
|
|
| 118 | 145 |
self._call_box = Gtk.Box(
|
| 119 | 146 |
orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
| 120 | 147 |
self._call_box.set_size_request(350, -1)
|
| ... | ... | @@ -150,17 +177,38 @@ def _prepare_incoming_call(self): |
| 150 | 177 |
label.set_line_wrap(True)
|
| 151 | 178 |
self._call_box.add(label)
|
| 152 | 179 |
|
| 153 |
- self._accept_button = Gtk.Button.new_with_label(_('Accept Call'))
|
|
| 154 |
- self._accept_button.get_style_context().add_class('suggested-action')
|
|
| 180 |
+ self._decline_button = Gtk.Button()
|
|
| 181 |
+ if self._session is not None:
|
|
| 182 |
+ self._decline_button.set_sensitive(not self._session.accepted)
|
|
| 183 |
+ self._decline_button.get_style_context().add_class(
|
|
| 184 |
+ 'destructive-action')
|
|
| 185 |
+ self._decline_button.connect('clicked', self._on_decline)
|
|
| 186 |
+ decline_icon = Gtk.Image.new_from_icon_name(
|
|
| 187 |
+ 'call-stop-symbolic', Gtk.IconSize.DND)
|
|
| 188 |
+ self._decline_button.add(decline_icon)
|
|
| 189 |
+ decline_label = Gtk.Label(label=_('Decline'))
|
|
| 190 |
+ decline_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
|
|
| 191 |
+ decline_box.add(self._decline_button)
|
|
| 192 |
+ decline_box.add(decline_label)
|
|
| 193 |
+ |
|
| 194 |
+ self._accept_button = Gtk.Button()
|
|
| 195 |
+ if self._session is not None:
|
|
| 196 |
+ self._accept_button.set_sensitive(not self._session.accepted)
|
|
| 197 |
+ self._accept_button.get_style_context().add_class(
|
|
| 198 |
+ 'suggested-action')
|
|
| 155 | 199 |
self._accept_button.connect('clicked', self._on_accept)
|
| 156 |
- |
|
| 157 |
- self._reject_button = Gtk.Button.new_with_label(_('Reject'))
|
|
| 158 |
- self._reject_button.connect('clicked', self._on_reject)
|
|
| 159 |
- |
|
| 160 |
- button_box = Gtk.Box(spacing=12)
|
|
| 200 |
+ accept_icon = Gtk.Image.new_from_icon_name(
|
|
| 201 |
+ 'call-start-symbolic', Gtk.IconSize.DND)
|
|
| 202 |
+ self._accept_button.add(accept_icon)
|
|
| 203 |
+ accept_label = Gtk.Label(label=_('Accept'))
|
|
| 204 |
+ accept_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
|
|
| 205 |
+ accept_box.add(self._accept_button)
|
|
| 206 |
+ accept_box.add(accept_label)
|
|
| 207 |
+ |
|
| 208 |
+ button_box = Gtk.Box(spacing=50)
|
|
| 161 | 209 |
button_box.set_halign(Gtk.Align.CENTER)
|
| 162 |
- button_box.add(self._reject_button)
|
|
| 163 |
- button_box.add(self._accept_button)
|
|
| 210 |
+ button_box.add(decline_box)
|
|
| 211 |
+ button_box.add(accept_box)
|
|
| 164 | 212 |
self._call_box.add(button_box)
|
| 165 | 213 |
|
| 166 | 214 |
self.grid.attach(self._call_box, 1, 0, 1, 1)
|
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 |
from gajim.common import app
|
| 24 | 24 |
from gajim.common import ged
|
| 25 | 25 |
from gajim.common.const import AvatarSize
|
| 26 |
+from gajim.common.const import KindConstant
|
|
| 26 | 27 |
from gajim.common.file_props import FilesProp
|
| 27 | 28 |
from gajim.common.helpers import open_file
|
| 28 | 29 |
from gajim.common.i18n import _
|
| ... | ... | @@ -67,8 +68,36 @@ def __init__(self, account, contact, event=None, db_message=None): |
| 67 | 68 |
|
| 68 | 69 |
avatar_placeholder = Gtk.Box()
|
| 69 | 70 |
avatar_placeholder.set_size_request(AvatarSize.ROSTER, -1)
|
| 71 |
+ avatar_placeholder.set_valign(Gtk.Align.START)
|
|
| 70 | 72 |
self.grid.attach(avatar_placeholder, 0, 0, 1, 1)
|
| 71 | 73 |
|
| 74 |
+ if is_from_db:
|
|
| 75 |
+ if db_message.kind == KindConstant.FILE_TRANSFER_INCOMING:
|
|
| 76 |
+ contact = self._contact
|
|
| 77 |
+ is_self = True
|
|
| 78 |
+ else:
|
|
| 79 |
+ contact = self._client.get_module('Contacts').get_contact(
|
|
| 80 |
+ str(self._client.get_own_jid().bare))
|
|
| 81 |
+ is_self = False
|
|
| 82 |
+ else:
|
|
| 83 |
+ if event.name == 'file-request-sent':
|
|
| 84 |
+ contact = self._client.get_module('Contacts').get_contact(
|
|
| 85 |
+ str(self._client.get_own_jid().bare))
|
|
| 86 |
+ is_self = False
|
|
| 87 |
+ else:
|
|
| 88 |
+ contact = self._contact
|
|
| 89 |
+ is_self = True
|
|
| 90 |
+ |
|
| 91 |
+ scale = self.get_scale_factor()
|
|
| 92 |
+ avatar = contact.get_avatar(AvatarSize.ROSTER, scale, add_show=False)
|
|
| 93 |
+ avatar_image = Gtk.Image.new_from_surface(avatar)
|
|
| 94 |
+ avatar_placeholder.add(avatar_image)
|
|
| 95 |
+ |
|
| 96 |
+ name_widget = self.create_name_widget(contact.name, is_self)
|
|
| 97 |
+ name_widget.set_halign(Gtk.Align.START)
|
|
| 98 |
+ name_widget.set_valign(Gtk.Align.START)
|
|
| 99 |
+ self.grid.attach(name_widget, 1, 0, 1, 1)
|
|
| 100 |
+ |
|
| 72 | 101 |
timestamp_widget = self.create_timestamp_widget(self.timestamp)
|
| 73 | 102 |
timestamp_widget.set_hexpand(True)
|
| 74 | 103 |
timestamp_widget.set_halign(Gtk.Align.END)
|
| ... | ... | @@ -76,7 +105,7 @@ def __init__(self, account, contact, event=None, db_message=None): |
| 76 | 105 |
self.grid.attach(timestamp_widget, 2, 0, 1, 1)
|
| 77 | 106 |
|
| 78 | 107 |
self._ui = get_builder('file_transfer_jingle.ui')
|
| 79 |
- self.grid.attach(self._ui.transfer_box, 1, 0, 1, 1)
|
|
| 108 |
+ self.grid.attach(self._ui.transfer_box, 1, 1, 1, 1)
|
|
| 80 | 109 |
|
| 81 | 110 |
self._ui.connect_signals(self)
|
| 82 | 111 |
|
| ... | ... | @@ -60,7 +60,7 @@ class ConversationView(Gtk.ListBox): |
| 60 | 60 |
None,
|
| 61 | 61 |
(object, )
|
| 62 | 62 |
),
|
| 63 |
- 'reject-call': (
|
|
| 63 |
+ 'decline-call': (
|
|
| 64 | 64 |
GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
|
| 65 | 65 |
None,
|
| 66 | 66 |
(object, )
|
| ... | ... | @@ -468,8 +468,8 @@ def on_mention(self, name): |
| 468 | 468 |
def accept_call(self, event):
|
| 469 | 469 |
self.emit('accept-call', event)
|
| 470 | 470 |
|
| 471 |
- def reject_call(self, event):
|
|
| 472 |
- self.emit('reject-call', event)
|
|
| 471 |
+ def decline_call(self, event):
|
|
| 472 |
+ self.emit('decline-call', event)
|
|
| 473 | 473 |
|
| 474 | 474 |
def _on_contact_setting_changed(self, *args):
|
| 475 | 475 |
self.invalidate_filter()
|