Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
norstbox
gajim
Commits
f5059b4e
Commit
f5059b4e
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
fix closing a tab
parent
5fbea471
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/message_window.py
+42
-32
42 additions, 32 deletions
src/message_window.py
with
42 additions
and
32 deletions
src/message_window.py
+
42
−
32
View file @
f5059b4e
...
...
@@ -439,46 +439,56 @@ class MessageWindow(object):
def
remove_tab
(
self
,
ctrl
,
method
,
reason
=
None
,
force
=
False
):
'''
reason is only for gc (offline status message)
if force is True, do not ask any confirmation
'''
# Shutdown the MessageControl
allow_shutdown
=
ctrl
.
allow_shutdown
(
method
)
if
not
force
and
allow_shutdown
==
'
no
'
:
return
if
allow_shutdown
==
'
minimize
'
and
method
!=
self
.
CLOSE_COMMAND
:
ctrl
.
minimize
()
self
.
check_tabs
()
return
if
reason
is
not
None
:
# We are leaving gc with a status message
ctrl
.
shutdown
(
reason
)
else
:
# We are leaving gc without status message or it's a chat
ctrl
.
shutdown
()
def
close
(
ctrl
):
if
reason
is
not
None
:
# We are leaving gc with a status message
ctrl
.
shutdown
(
reason
)
else
:
# We are leaving gc without status message or it's a chat
ctrl
.
shutdown
()
# Update external state
gajim
.
events
.
remove_events
(
ctrl
.
account
,
ctrl
.
get_full_jid
,
types
=
[
'
printed_msg
'
,
'
chat
'
,
'
gc_msg
'
])
# Update external state
gajim
.
events
.
remove_events
(
ctrl
.
account
,
ctrl
.
get_full_jid
,
types
=
[
'
printed_msg
'
,
'
chat
'
,
'
gc_msg
'
])
fjid
=
ctrl
.
get_full_jid
()
jid
=
gajim
.
get_jid_without_resource
(
fjid
)
fjid
=
ctrl
.
get_full_jid
()
jid
=
gajim
.
get_jid_without_resource
(
fjid
)
fctrl
=
self
.
get_control
(
fjid
,
ctrl
.
account
)
bctrl
=
self
.
get_control
(
jid
,
ctrl
.
account
)
# keep last_message_time around unless this was our last control with
# that jid
if
not
fctrl
and
not
bctrl
:
del
gajim
.
last_message_time
[
ctrl
.
account
][
fjid
]
fctrl
=
self
.
get_control
(
fjid
,
ctrl
.
account
)
bctrl
=
self
.
get_control
(
jid
,
ctrl
.
account
)
# keep last_message_time around unless this was our last control with
# that jid
if
not
fctrl
and
not
bctrl
:
del
gajim
.
last_message_time
[
ctrl
.
account
][
fjid
]
# Disconnect tab DnD only if GTK version < 2.10
if
gtk
.
pygtk_version
<
(
2
,
10
,
0
)
or
gtk
.
gtk_version
<
(
2
,
10
,
0
):
self
.
disconnect_tab_dnd
(
ctrl
.
widget
)
# Disconnect tab DnD only if GTK version < 2.10
if
gtk
.
pygtk_version
<
(
2
,
10
,
0
)
or
gtk
.
gtk_version
<
(
2
,
10
,
0
):
self
.
disconnect_tab_dnd
(
ctrl
.
widget
)
self
.
notebook
.
remove_page
(
self
.
notebook
.
page_num
(
ctrl
.
widget
))
self
.
notebook
.
remove_page
(
self
.
notebook
.
page_num
(
ctrl
.
widget
))
del
self
.
_controls
[
ctrl
.
account
][
fjid
]
del
self
.
_controls
[
ctrl
.
account
][
fjid
]
if
len
(
self
.
_controls
[
ctrl
.
account
])
==
0
:
del
self
.
_controls
[
ctrl
.
account
]
if
len
(
self
.
_controls
[
ctrl
.
account
])
==
0
:
del
self
.
_controls
[
ctrl
.
account
]
self
.
check_tabs
()
self
.
show_title
()
self
.
check_tabs
()
self
.
show_title
()
def
on_yes
(
ctrl
):
close
(
ctrl
)
def
on_no
(
ctrl
):
if
not
force
:
return
close
(
ctrl
)
def
on_minimize
(
ctrl
):
if
method
!=
self
.
CLOSE_COMMAND
:
ctrl
.
minimize
()
self
.
check_tabs
()
return
close
(
ctrl
)
# Shutdown the MessageControl
ctrl
.
allow_shutdown
(
method
,
on_yes
,
on_no
,
on_minimize
)
def
check_tabs
(
self
):
if
self
.
get_num_controls
()
==
0
:
...
...
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