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
67291fd4
Commit
67291fd4
authored
Feb 24, 2014
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added default user icon descriptor on ChatWidget
parent
e4b32d23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
chatwindow.py
blink/chatwindow.py
+18
-1
No files found.
blink/chatwindow.py
View file @
67291fd4
...
...
@@ -453,9 +453,26 @@ class ChatTextInput(QTextEdit):
self
.
setTextCursor
(
cursor
)
class
IconDescriptor
(
object
):
def
__init__
(
self
,
filename
):
self
.
filename
=
filename
self
.
icon
=
None
def
__get__
(
self
,
obj
,
objtype
):
if
self
.
icon
is
None
:
self
.
icon
=
QIcon
(
self
.
filename
)
self
.
icon
.
filename
=
self
.
filename
return
self
.
icon
def
__set__
(
self
,
obj
,
value
):
raise
AttributeError
(
"attribute cannot be set"
)
def
__delete__
(
self
,
obj
):
raise
AttributeError
(
"attribute cannot be deleted"
)
ui_class
,
base_class
=
uic
.
loadUiType
(
Resources
.
get
(
'chat_widget.ui'
))
class
ChatWidget
(
base_class
,
ui_class
):
default_user_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/default-avatar.png'
))
def
__init__
(
self
,
session
,
parent
=
None
):
super
(
ChatWidget
,
self
)
.
__init__
(
parent
)
with
Resources
.
directory
:
...
...
@@ -585,7 +602,7 @@ class ChatWidget(base_class, ui_class):
account
=
chat_stream
.
blink_session
.
account
display_name
=
account
.
display_name
uri
=
account
.
id
icon
=
IconManager
()
.
get
(
'avatar'
)
or
self
.
session
.
default_user_icon
icon
=
IconManager
()
.
get
(
'avatar'
)
or
self
.
default_user_icon
sender
=
ChatSender
(
display_name
,
uri
,
icon
.
filename
)
self
.
add_message
(
ChatMessage
(
text
,
sender
,
'outgoing'
))
...
...
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