show/hide ipython window instead of create/destroy

This commit is contained in:
Yann Leboulanger 2008-04-15 18:09:04 +00:00
parent 88f7abd795
commit 6d8dd51db0
2 changed files with 8 additions and 6 deletions

View File

@ -2820,11 +2820,10 @@ class Interface:
sw.add(view)
window.add(sw)
window.show_all()
window.connect('delete_event',lambda x,y:False)
def on_destroy(win):
gajim.ipython_window = None
def on_delete(win, event):
win.hide()
return True
window.connect('destroy', on_destroy)
window.connect('delete_event',on_delete)
view.updateNamespace({'gajim': gajim})
gajim.ipython_window = window

View File

@ -479,8 +479,11 @@ class SignalObject(dbus.service.Object):
''' shows/hides the ipython window '''
win = gajim.ipython_window
if win:
win.destroy()
gajim.ipython_window = None
if win.window.is_visible():
gobject.idle_add(win.hide)
else:
win.show_all()
win.present()
else:
gajim.interface.create_ipython_window()