Commit 1508c2b571dc672c1c959faa0b80b641e245c3c7
1 parent
9f833ffc
Exists in
master
and in
35 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,7 +353,8 @@ class Frame(wx.Frame): | ||
| 353 | Close all project data. | 353 | Close all project data. |
| 354 | """ | 354 | """ |
| 355 | Publisher.sendMessage('Close Project') | 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 | Publisher.sendMessage('Exit') | 358 | Publisher.sendMessage('Exit') |
| 358 | 359 | ||
| 359 | def OnMenuClick(self, evt): | 360 | def OnMenuClick(self, evt): |
invesalius/session.py
| @@ -37,6 +37,9 @@ class Session(object): | @@ -37,6 +37,9 @@ class Session(object): | ||
| 37 | 37 | ||
| 38 | def __init__(self): | 38 | def __init__(self): |
| 39 | self.temp_item = False | 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 | def CreateItens(self): | 44 | def CreateItens(self): |
| 42 | import constants as const | 45 | import constants as const |
| @@ -246,7 +249,9 @@ class Session(object): | @@ -246,7 +249,9 @@ class Session(object): | ||
| 246 | try: | 249 | try: |
| 247 | config.read(path) | 250 | config.read(path) |
| 248 | self.mode = config.get('session', 'mode') | 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 | self.debug = config.get('session','debug') | 255 | self.debug = config.get('session','debug') |
| 251 | self.language = config.get('session','language') | 256 | self.language = config.get('session','language') |
| 252 | self.recent_projects = eval(config.get('project','recent_projects')) | 257 | self.recent_projects = eval(config.get('project','recent_projects')) |