Пример #1
0
    def OnOpenRecentProject(self, pubsub_evt):
        filepath = pubsub_evt.data

        if os.path.exists(filepath):
            session = ses.Session()
            st = session.project_status
            if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE):
                filename = session.project_path[1]
                answer = dialog.SaveChangesDialog2(filename)
                if answer:
                    self.ShowDialogSaveProject()
            self.CloseProject()
            self.OpenProject(filepath)
        else:
            dialog.InexistentPath(filepath)
Пример #2
0
    def ShowDialogOpenProject(self):
        # Offer to save current project if necessary
        session = ses.Session()
        st = session.project_status
        if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE):
            filename = session.project_path[1]
            answer = dialog.SaveChangesDialog2(filename)
            if answer:
                self.ShowDialogSaveProject()

        # Open project
        filepath = dialog.ShowOpenProjectDialog()
        if filepath:
            self.CloseProject()
            self.OpenProject(filepath)
Пример #3
0
 def ShowDialogImportDirectory(self):
     # Offer to save current project if necessary
     session = ses.Session()
     st = session.project_status
     if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE):
         filename = session.project_path[1]
         answer = dialog.SaveChangesDialog2(filename)
         if answer:
             self.ShowDialogSaveProject()
         self.CloseProject()
         #Publisher.sendMessage("Enable state project", False)
         Publisher.sendMessage('Set project name')
         Publisher.sendMessage("Stop Config Recording")
         Publisher.sendMessage("Set slice interaction style", const.STATE_DEFAULT)
     # Import project
     dirpath = dialog.ShowImportDirDialog()
     if dirpath and not os.listdir(dirpath):
         dialog.ImportEmptyDirectory(dirpath)
     elif dirpath:
         self.StartImportPanel(dirpath)
         Publisher.sendMessage("Load data to import panel", dirpath)