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
23a64356
Commit
23a64356
authored
Nov 25, 2014
by
Saul Ibarra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stopping composing timer when session is ended or chat is removed
parent
bb6d1f72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
chatwindow.py
blink/chatwindow.py
+20
-0
No files found.
blink/chatwindow.py
View file @
23a64356
...
@@ -484,6 +484,8 @@ class IconDescriptor(object):
...
@@ -484,6 +484,8 @@ class IconDescriptor(object):
ui_class
,
base_class
=
uic
.
loadUiType
(
Resources
.
get
(
'chat_widget.ui'
))
ui_class
,
base_class
=
uic
.
loadUiType
(
Resources
.
get
(
'chat_widget.ui'
))
class
ChatWidget
(
base_class
,
ui_class
):
class
ChatWidget
(
base_class
,
ui_class
):
implements
(
IObserver
)
default_user_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/default-avatar.png'
))
default_user_icon
=
IconDescriptor
(
Resources
.
get
(
'icons/default-avatar.png'
))
chat_template
=
open
(
Resources
.
get
(
'chat/template.html'
))
.
read
()
chat_template
=
open
(
Resources
.
get
(
'chat/template.html'
))
.
read
()
...
@@ -502,6 +504,9 @@ class ChatWidget(base_class, ui_class):
...
@@ -502,6 +504,9 @@ class ChatWidget(base_class, ui_class):
self
.
composing_timer
=
QTimer
()
self
.
composing_timer
=
QTimer
()
self
.
last_message
=
None
self
.
last_message
=
None
self
.
session
=
session
self
.
session
=
session
if
session
is
not
None
:
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
ObserverWeakrefProxy
(
self
),
sender
=
session
.
blink_session
)
# connect to signals
# connect to signals
self
.
chat_input
.
textChanged
.
connect
(
self
.
_SH_ChatInputTextChanged
)
self
.
chat_input
.
textChanged
.
connect
(
self
.
_SH_ChatInputTextChanged
)
self
.
chat_input
.
textEntered
.
connect
(
self
.
_SH_ChatInputTextEntered
)
self
.
chat_input
.
textEntered
.
connect
(
self
.
_SH_ChatInputTextEntered
)
...
@@ -626,6 +631,21 @@ class ChatWidget(base_class, ui_class):
...
@@ -626,6 +631,21 @@ class ChatWidget(base_class, ui_class):
except
Exception
:
except
Exception
:
pass
pass
@
run_in_gui_thread
def
handle_notification
(
self
,
notification
):
handler
=
getattr
(
self
,
'_NH_
%
s'
%
notification
.
name
,
Null
)
handler
(
notification
)
def
_NH_BlinkSessionDidEnd
(
self
,
notification
):
self
.
composing_timer
.
stop
()
def
_NH_BlinkSessionWasDeleted
(
self
,
notification
):
self
.
setParent
(
None
)
def
_NH_BlinkSessionDidRemoveStream
(
self
,
notification
):
if
notification
.
data
.
stream
.
type
==
'chat'
:
self
.
composing_timer
.
stop
()
del
ui_class
,
base_class
del
ui_class
,
base_class
...
...
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