version 1.1 | | version 1.2 |
---|
| | |
Edit AppEditInsert(App self,String path,EditType type) | | Edit AppEditInsert(App self,String path,EditType type) |
{ | | { |
Edit edit; | | Edit edit; |
| | Edit editor; |
char buf[BUFSIZ]; | | char buf[BUFSIZ]; |
| | |
/*** check if exist ***/ | | /*** check if exist ***/ |
if(has_been_loaded (path)) { | | /* Dragon Master */ |
sprintf(buf,"%s aready in memory",path); | | for(editor = self->edit; editor; editor = editor->next) |
CnvNotify(buf,"Continue",NULL); | | if(!strcmp(editor->emap->path, path)) { |
return NULL; | | /*** save, if modified ***/ |
| | if (editor->modified) { |
| | switch (CnvNotify ("Map modified, discard changes?", |
| | "OK","Save Changes","Cancel",NULL)) { |
| | case 1: |
| | EditLoad(editor); |
| | break; |
| | case 2: |
| | EditSave(editor); |
| | break; |
| | default: |
| | break; |
| | } |
} | | } |
| | XRaiseWindow(editor->app->display, XtWindow(editor->shell)); |
| | return editor; |
| | } |
| | |
/*** create new one ***/ | | /*** create new one ***/ |
if((edit = EditCreate(self,type,path)) == NULL) { | | if((edit = EditCreate(self,type,path)) == NULL) { |
return NULL; | | return NULL; |