Commit 1508c2b571dc672c1c959faa0b80b641e245c3c7
1 parent
9f833ffc
Exists in
master
and in
2 other branches
Initializing Invesalius status as proj_close
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
invesalius/gui/frame.py
| ... | ... | @@ -353,7 +353,8 @@ class Frame(wx.Frame): |
| 353 | 353 | Close all project data. |
| 354 | 354 | """ |
| 355 | 355 | Publisher.sendMessage('Close Project') |
| 356 | - if not ses.Session().IsOpen(): | |
| 356 | + s = ses.Session() | |
| 357 | + if not s.IsOpen() or not s.project_path: | |
| 357 | 358 | Publisher.sendMessage('Exit') |
| 358 | 359 | |
| 359 | 360 | def OnMenuClick(self, evt): | ... | ... |
invesalius/session.py
| ... | ... | @@ -37,6 +37,9 @@ class Session(object): |
| 37 | 37 | |
| 38 | 38 | def __init__(self): |
| 39 | 39 | self.temp_item = False |
| 40 | + # Initializing as project status closed. | |
| 41 | + # TODO: A better way to initialize project_status as closed (3) | |
| 42 | + self.project_status = 3 | |
| 40 | 43 | |
| 41 | 44 | def CreateItens(self): |
| 42 | 45 | import constants as const |
| ... | ... | @@ -246,7 +249,9 @@ class Session(object): |
| 246 | 249 | try: |
| 247 | 250 | config.read(path) |
| 248 | 251 | self.mode = config.get('session', 'mode') |
| 249 | - self.project_status = config.get('session', 'status') | |
| 252 | + # Do not reading project status from the config file, since there | |
| 253 | + # isn't a recover sessession tool in InVesalius | |
| 254 | + #self.project_status = int(config.get('session', 'status')) | |
| 250 | 255 | self.debug = config.get('session','debug') |
| 251 | 256 | self.language = config.get('session','language') |
| 252 | 257 | self.recent_projects = eval(config.get('project','recent_projects')) | ... | ... |