Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 045cd743 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Try to fix windows crashes without parent...

parent a20c82d5
...@@ -361,7 +361,7 @@ class ImportPIDParam(object): ...@@ -361,7 +361,7 @@ class ImportPIDParam(object):
""" """
Widget for model importing Widget for model importing
""" """
def __init__(self, chart, parent): def __init__(self, chart, parent=None):
self.charter = chart self.charter = chart
# window creation # window creation
...@@ -380,7 +380,8 @@ class ImportPIDParam(object): ...@@ -380,7 +380,8 @@ class ImportPIDParam(object):
# Set modal mode for the window (above all windows & block inputs) # Set modal mode for the window (above all windows & block inputs)
self.main_window.set_modal(True) self.main_window.set_modal(True)
self.main_window.set_transient_for(parent) if parent:
self.main_window.set_transient_for(parent)
if self.main_window: if self.main_window:
self.main_window.connect("destroy", self.on_destroy) self.main_window.connect("destroy", self.on_destroy)
...@@ -496,7 +497,7 @@ class ImportBioPAXParams(object): ...@@ -496,7 +497,7 @@ class ImportBioPAXParams(object):
.. note:: requires biopax2cadbiom module .. note:: requires biopax2cadbiom module
""" """
def __init__(self, chart, parent): def __init__(self, chart, parent=None):
self.charter = chart self.charter = chart
try: try:
...@@ -534,7 +535,8 @@ class ImportBioPAXParams(object): ...@@ -534,7 +535,8 @@ class ImportBioPAXParams(object):
# Set modal mode for the window (above all windows & block inputs) # Set modal mode for the window (above all windows & block inputs)
self.main_window.set_modal(True) self.main_window.set_modal(True)
self.main_window.set_transient_for(parent) if parent:
self.main_window.set_transient_for(parent)
if self.main_window: if self.main_window:
self.main_window.connect("destroy", self.on_destroy) self.main_window.connect("destroy", self.on_destroy)
......
...@@ -350,7 +350,7 @@ class SCCWindow(object): ...@@ -350,7 +350,7 @@ class SCCWindow(object):
""" """
Class used for displaying frontier isolated components Class used for displaying frontier isolated components
""" """
def __init__(self, l_fsol, emvc, reporter, parent): def __init__(self, l_fsol, emvc, reporter, parent=None):
""" """
@param l_fsol: list<list<string>> @param l_fsol: list<list<string>>
@param emvc: edit_mvc @param emvc: edit_mvc
...@@ -383,7 +383,11 @@ class SCCWindow(object): ...@@ -383,7 +383,11 @@ class SCCWindow(object):
self.window.set_size_request(700, height) self.window.set_size_request(700, height)
# Set window above all windows # Set window above all windows
self.window.set_transient_for(parent.main_window) self.parent = parent
if parent:
self.window.set_transient_for(parent.main_window)
# register
parent.win_register(self.window)
# Event on_escape key pressed # Event on_escape key pressed
self.window.connect('key_press_event', self.on_escape) self.window.connect('key_press_event', self.on_escape)
...@@ -406,10 +410,6 @@ class SCCWindow(object): ...@@ -406,10 +410,6 @@ class SCCWindow(object):
vbox = self.wtree.get_widget("vbox1") vbox = self.wtree.get_widget("vbox1")
vbox.remove(hbbox) vbox.remove(hbbox)
# register
parent.win_register(self.window)
self.parent = parent
# display # display
self.window.show_all() self.window.show_all()
#gtk.main() #gtk.main()
...@@ -582,15 +582,16 @@ class SCCWindow(object): ...@@ -582,15 +582,16 @@ class SCCWindow(object):
# sub windows management # sub windows management
def win_register(self, win): def win_register(self, win):
""" """
sub windows management sub windows management => useless, no subwin
""" """
print "register subsubwin"
if win.__class__ == ChartSimulControler: if win.__class__ == ChartSimulControler:
self.simul = win self.simul = win
self.aux_win.append(win) self.aux_win.append(win)
def win_remove(self, win): def win_remove(self, win):
""" """
sub windows management sub windows management => useless, no subwin
""" """
if win in self.aux_win: if win in self.aux_win:
self.aux_win.remove(win) self.aux_win.remove(win)
...@@ -599,7 +600,7 @@ class SCCWindow(object): ...@@ -599,7 +600,7 @@ class SCCWindow(object):
def clean_subwin(self): def clean_subwin(self):
""" """
sub windows management sub windows management => useless, no subwin
""" """
for win in self.aux_win: for win in self.aux_win:
win.destroy() win.destroy()
...@@ -607,7 +608,7 @@ class SCCWindow(object): ...@@ -607,7 +608,7 @@ class SCCWindow(object):
class BAGWindow(SCCWindow): class BAGWindow(SCCWindow):
def __init__(self, l_fsol, emvc, reporter, parent): def __init__(self, l_fsol, emvc, reporter, parent=None):
""" """
@param l_fsol: list<list<string>> @param l_fsol: list<list<string>>
@param emvc: edit_mvc @param emvc: edit_mvc
...@@ -750,7 +751,7 @@ class STATWindow(BAGWindow): ...@@ -750,7 +751,7 @@ class STATWindow(BAGWindow):
""" """
Class for displaying statistics Class for displaying statistics
""" """
def __init__(self, stat, emvc, reporter, parent): def __init__(self, stat, emvc, reporter, parent=None):
""" """
@param l_fsol: list<list<string>> @param l_fsol: list<list<string>>
@param emvc: edit_mvc @param emvc: edit_mvc
......
...@@ -926,7 +926,11 @@ class Charter(object): ...@@ -926,7 +926,11 @@ class Charter(object):
used by: STATWindow, SCCWindow, BAGWindow, LegendWindow used by: STATWindow, SCCWindow, BAGWindow, LegendWindow
""" """
self.subwindows.remove(window)
try:
self.subwindows.remove(window)
except KeyError:
pass
window.destroy() window.destroy()
# Solve model # Solve model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment