Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
4affa97a
Commit
4affa97a
authored
Apr 21, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added status support for messages in chat
parent
170eb7ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
chatwindow.py
blink/chatwindow.py
+16
-0
No files found.
blink/chatwindow.py
View file @
4affa97a
...
@@ -66,6 +66,7 @@ class ChatHtmlTemplates(object):
...
@@ -66,6 +66,7 @@ class ChatHtmlTemplates(object):
self
.
message
=
open
(
os
.
path
.
join
(
style_path
,
'html/message.html'
))
.
read
()
self
.
message
=
open
(
os
.
path
.
join
(
style_path
,
'html/message.html'
))
.
read
()
self
.
message_continuation
=
open
(
os
.
path
.
join
(
style_path
,
'html/message_continuation.html'
))
.
read
()
self
.
message_continuation
=
open
(
os
.
path
.
join
(
style_path
,
'html/message_continuation.html'
))
.
read
()
self
.
notification
=
open
(
os
.
path
.
join
(
style_path
,
'html/notification.html'
))
.
read
()
self
.
notification
=
open
(
os
.
path
.
join
(
style_path
,
'html/notification.html'
))
.
read
()
self
.
status
=
open
(
os
.
path
.
join
(
style_path
,
'html/message_status.html'
))
.
read
()
except
(
OSError
,
IOError
):
except
(
OSError
,
IOError
):
raise
ChatStyleError
(
"missing or unreadable chat message html template files in
%
s"
%
os
.
path
.
join
(
style_path
,
'html'
))
raise
ChatStyleError
(
"missing or unreadable chat message html template files in
%
s"
%
os
.
path
.
join
(
style_path
,
'html'
))
...
@@ -270,6 +271,19 @@ class ChatContent(object, metaclass=ABCMeta):
...
@@ -270,6 +271,19 @@ class ChatContent(object, metaclass=ABCMeta):
raise
NotImplementedError
raise
NotImplementedError
class
ChatMessageStatus
(
ChatContent
):
__cssclasses__
=
(
'status-icon'
,)
def
__init__
(
self
,
status
,
iconpath
,
id
):
super
(
ChatMessageStatus
,
self
)
.
__init__
(
status
)
self
.
status
=
status
self
.
iconpath
=
QUrl
.
fromLocalFile
(
iconpath
)
.
toString
()
self
.
id
=
id
def
to_html
(
self
,
style
,
**
kw
):
return
style
.
html
.
status
.
format
(
message
=
self
,
**
kw
)
class
ChatNotification
(
ChatContent
):
class
ChatNotification
(
ChatContent
):
__cssclasses__
=
(
'event'
,)
__cssclasses__
=
(
'event'
,)
...
@@ -621,6 +635,8 @@ ui_class, base_class = uic.loadUiType(Resources.get('chat_widget.ui'))
...
@@ -621,6 +635,8 @@ ui_class, base_class = uic.loadUiType(Resources.get('chat_widget.ui'))
class
ChatWidget
(
base_class
,
ui_class
):
class
ChatWidget
(
base_class
,
ui_class
):
default_user_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/default-avatar.png'
))
default_user_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/default-avatar.png'
))
checkmark_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/checkmark.svg'
))
warning_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/warning.svg'
))
chat_template
=
open
(
Resources
.
get
(
'chat/template.html'
))
.
read
()
chat_template
=
open
(
Resources
.
get
(
'chat/template.html'
))
.
read
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment