Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar GTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar GTK
Commits
ecdb5b25
Commit
ecdb5b25
authored
5 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
Disconnect from socket listener signal when closing private chat
Fixes
#44
parent
f154d4d0
No related branches found
No related tags found
1 merge request
!19
Disconnect from socket listener signal when closing private chat
Pipeline
#4296
canceled
5 years ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
briar-gtk/briar_gtk/containers/main_window.py
+2
-2
2 additions, 2 deletions
briar-gtk/briar_gtk/containers/main_window.py
briar-gtk/briar_gtk/containers/private_chat.py
+17
-3
17 additions, 3 deletions
briar-gtk/briar_gtk/containers/private_chat.py
with
19 additions
and
5 deletions
briar-gtk/briar_gtk/containers/main_window.py
+
2
−
2
View file @
ecdb5b25
...
@@ -125,7 +125,7 @@ class MainWindowContainer(Container):
...
@@ -125,7 +125,7 @@ class MainWindowContainer(Container):
def
_clear_history_container
(
self
):
def
_clear_history_container
(
self
):
children
=
self
.
history_container
.
get_children
()
children
=
self
.
history_container
.
get_children
()
for
child
in
children
:
for
child
in
children
:
self
.
history_container
.
remove
(
child
)
child
.
destroy
(
)
def
_setup_view
(
self
):
def
_setup_view
(
self
):
self
.
_add_from_resource
(
self
.
MENU_UI
)
self
.
_add_from_resource
(
self
.
MENU_UI
)
...
@@ -174,4 +174,4 @@ class MainWindowContainer(Container):
...
@@ -174,4 +174,4 @@ class MainWindowContainer(Container):
def
_clear_contact_list
(
self
):
def
_clear_contact_list
(
self
):
contacts_list_box_children
=
self
.
contacts_list_box
.
get_children
()
contacts_list_box_children
=
self
.
contacts_list_box
.
get_children
()
for
child
in
contacts_list_box_children
:
for
child
in
contacts_list_box_children
:
self
.
contacts_list_box
.
remove
(
child
)
child
.
destroy
(
)
This diff is collapsed.
Click to expand it.
briar-gtk/briar_gtk/containers/private_chat.py
+
17
−
3
View file @
ecdb5b25
...
@@ -23,6 +23,7 @@ class PrivateChatContainer(Container):
...
@@ -23,6 +23,7 @@ class PrivateChatContainer(Container):
def
__init__
(
self
,
contact_name
,
contact_id
):
def
__init__
(
self
,
contact_name
,
contact_id
):
super
().
__init__
()
super
().
__init__
()
self
.
_signals
=
list
()
self
.
_contact_name
=
contact_name
self
.
_contact_name
=
contact_name
self
.
_contact_id
=
contact_id
self
.
_contact_id
=
contact_id
...
@@ -70,6 +71,18 @@ class PrivateChatContainer(Container):
...
@@ -70,6 +71,18 @@ class PrivateChatContainer(Container):
self
.
add
(
messages_scroll
)
self
.
add
(
messages_scroll
)
self
.
builder
.
connect_signals
(
self
)
self
.
builder
.
connect_signals
(
self
)
self
.
_setup_destroy_listener
()
def
_setup_destroy_listener
(
self
):
self
.
connect
(
"
destroy
"
,
self
.
_on_destroy
)
# pylint: disable=unused-argument
def
_on_destroy
(
self
,
widget
):
self
.
_disconnect_signals
()
def
_disconnect_signals
(
self
):
for
signal
in
self
.
_signals
:
APP
().
api
.
socket_listener
.
disconnect
(
signal
)
def
_load_content
(
self
):
def
_load_content
(
self
):
private_chat
=
PrivateChat
(
APP
().
api
,
self
.
_contact_id
)
private_chat
=
PrivateChat
(
APP
().
api
,
self
.
_contact_id
)
...
@@ -79,9 +92,10 @@ class PrivateChatContainer(Container):
...
@@ -79,9 +92,10 @@ class PrivateChatContainer(Container):
# Abusing idle_add function here because otherwise the message box
# Abusing idle_add function here because otherwise the message box
# is too small and scrolling cuts out messages
# is too small and scrolling cuts out messages
GLib
.
idle_add
(
self
.
_add_message
,
message
)
GLib
.
idle_add
(
self
.
_add_message
,
message
)
# TODO: Disconnect if no more needed
socket_listener
=
APP
().
api
.
socket_listener
APP
().
api
.
socket_listener
.
connect
(
"
ConversationMessageReceivedEvent
"
,
signal_id
=
socket_listener
.
connect
(
"
ConversationMessageReceivedEvent
"
,
self
.
_add_message_async
)
self
.
_add_message_async
)
self
.
_signals
.
append
(
signal_id
)
def
_add_message
(
self
,
message
):
def
_add_message
(
self
,
message
):
message_widget
=
PrivateMessageWidget
(
self
.
_contact_name
,
message
)
message_widget
=
PrivateMessageWidget
(
self
.
_contact_name
,
message
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment