Example #1
0
    def NewArchive(self, evt=None):
        selected = False
        while not selected:
            dlg = Dialogs.eDevNewArchiveDialog(self, -1)
            if dlg.ShowModal() == wx.ID_CANCEL: return
            uri = dlg.getSelection()
            dlg.Destroy()

            if self._d_model.checkURI(uri):
                # FIXME ask for overwrite
                continue
            selected = True
        self._d_model.saveURI(uri,"")
        self.addURI(uri)
 def OnSaveAs(self, evt=None):
     selected = False
     while not selected:
         dlg = Dialogs.eDevSaveModuleAsDialog(self, -1)
         if dlg.ShowModal() != wx.ID_OK:
             return
         uri = "mod://%s"%dlg.getSelection()
         dlg.Destroy()
         if self._model.checkURI(uri):
             # FIXME Override?
             continue
         selected = True
     
     if not self._model.checkURI(uri):
         self._controller.DocumentSave(uri, self._toXML())
         self._moduletree.addURI(uri)
     else:
         self._controller.DocumentSave(uri, self._toXML())
     self.setURI(uri)
     self.setTitle( getModuleName(uri) )
    def OnSaveAs(self, evt=None):
        selected = False
        while not selected:
            dlg = Dialogs.eDevSaveAsDialog(self, -1)
            if dlg.ShowModal() != wx.ID_OK:
                return
            uri = "zip://%s/%s" % dlg.getSelection()
            dlg.Destroy()
            if self._d_model.checkURI(uri):
                # FIXME Override?
                continue
            selected = True

        if not self._d_model.checkURI(uri):
            self._d_controller.DocumentSave(uri, self.GetText())
            self._archive_tree.addURI(uri)
        else:
            self._d_controller.DocumentSave(uri, self.GetText())
        self.setURI(uri)
        self._logger.debug("rename to " + uri)
        self._d_notebook.setPageTitleByURI(uri, getPyFile(uri))