Ejemplo n.º 1
0
 def load_project(self, path):
     project_view = self.frame.project_view
     self.project = project.Project.load(path)
     menu.manager.publish(menu.PROJECT_OPEN)
     project_view.set_project(self.project)
     settings.session_set('project_filename', path)
     evt = AppEvent(EVT_APP_PROJECT_OPENED, self, data=self.project)
     wx.PostEvent(self, evt)
Ejemplo n.º 2
0
 def load_project(self, path):
     project_view = self.frame.project_view
     self.project = project.Project.load(path)
     menu.manager.publish(menu.PROJECT_OPEN)
     project_view.set_project(self.project)
     settings.session_set('project_filename', path)
     evt = AppEvent(EVT_APP_PROJECT_OPENED, self, data=self.project)
     wx.PostEvent(self, evt)
Ejemplo n.º 3
0
 def unload_project(self):
     if self.project:
         self.project = None
         menu.manager.publish(menu.PROJECT_CLOSE)
         self.frame.project_view.set_project(None)
         settings.session_set('project_filename', '')
         self.detach()
         evt = AppEvent(EVT_APP_PROJECT_CLOSED, self)
         wx.PostEvent(self, evt)
Ejemplo n.º 4
0
 def unload_project(self):
     if self.project:
         self.project = None
         menu.manager.publish(menu.PROJECT_CLOSE)
         self.frame.project_view.set_project(None)
         settings.session_set('project_filename', '')
         self.detach()
         evt = AppEvent(EVT_APP_PROJECT_CLOSED, self)
         wx.PostEvent(self, evt)
Ejemplo n.º 5
0
 def save_session(self):
     if self.project:
         settings.session_set('project_filename', self.project.filename)
         settings.session_set('open_files', self.frame.editor_view.open_files)
         settings.session_set('project_view_state', self.frame.project_view.save_state())
     if self.frame.editor_maximized:
         settings.session_set('perspective', self.frame.saved_perspective)
     else:
         settings.session_set('perspective', self.frame.manager.SavePerspective())
         
     settings.save_session()
Ejemplo n.º 6
0
 def on_persist(self, evt):
     maximized = self.IsMaximized()
     x,y = self.GetPosition()
     width,height = self.GetSize()
     print (maximized, x, y, width, height)
     import settings
     if not self.IsIconized():
         try:
             settings.session_set(str(self.__class__), (maximized, x, y, width, height))
             settings.save_session()
         except Exception, e:
             print "Couldn't persist window: %s" % e
         finally:
Ejemplo n.º 7
0
    def save_session(self):
        if self.project:
            settings.session_set('project_filename', self.project.filename)
            settings.session_set('open_files',
                                 self.frame.editor_view.open_files)
            settings.session_set('project_view_state',
                                 self.frame.project_view.save_state())
        if self.frame.editor_maximized:
            settings.session_set('perspective', self.frame.saved_perspective)
        else:
            settings.session_set('perspective',
                                 self.frame.manager.SavePerspective())

        settings.save_session()
Ejemplo n.º 8
0
 def on_persist(self, evt):
     maximized = self.IsMaximized()
     x, y = self.GetPosition()
     width, height = self.GetSize()
     print(maximized, x, y, width, height)
     import settings
     if not self.IsIconized():
         try:
             settings.session_set(str(self.__class__),
                                  (maximized, x, y, width, height))
             settings.save_session()
         except Exception, e:
             print "Couldn't persist window: %s" % e
         finally: