Subversion Repositories SvarDOS

Rev

Rev 1417 | Rev 1419 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1417 Rev 1418
Line 527... Line 527...
527
  }
527
  }
528
 
528
 
529
  /* zero out the struct */
529
  /* zero out the struct */
530
  bzero(db, sizeof(struct file));
530
  bzero(db, sizeof(struct file));
531
 
531
 
532
  if (*fname == 0) goto SKIPLOADING;
532
  if (fname == NULL) goto SKIPLOADING;
533
 
533
 
534
  memcpy(db->fname, fname, strlen(fname));
534
  memcpy(db->fname, fname, strlen(fname));
535
 
535
 
536
  if (_dos_open(fname, O_RDONLY, &fd) != 0) {
536
  if (_dos_open(fname, O_RDONLY, &fd) != 0) {
537
    return(1);
537
    return(1);
Line 813... Line 813...
813
  MENU_OPEN   = 1,
813
  MENU_OPEN   = 1,
814
  MENU_SAVE   = 2,
814
  MENU_SAVE   = 2,
815
  MENU_SAVEAS = 3,
815
  MENU_SAVEAS = 3,
816
  MENU_CLOSE  = 4,
816
  MENU_CLOSE  = 4,
817
  MENU_CHGEOL = 5,
817
  MENU_CHGEOL = 5,
818
  MENU_QUIT   = 6,
818
  MENU_QUIT   = 6
819
};
819
};
820
 
820
 
821
static enum MENU_ACTION ui_menu(void) {
821
static enum MENU_ACTION ui_menu(void) {
822
  unsigned short i, curchoice, attr, x, slen;
822
  unsigned short i, curchoice, attr, x, slen;
823
  unsigned short xorigin, yorigin;
823
  unsigned short xorigin, yorigin;
Line 902... Line 902...
902
  unsigned short curfile;
902
  unsigned short curfile;
903
  struct file *db = dbarr; /* visible file is the first slot by default */
903
  struct file *db = dbarr; /* visible file is the first slot by default */
904
  struct line far *clipboard = NULL;
904
  struct line far *clipboard = NULL;
905
  unsigned char original_breakflag;
905
  unsigned char original_breakflag;
906
 
906
 
907
  {
907
  { /* load NLS resource */
908
    unsigned short i = 0;
908
    unsigned short i = 0;
909
    const char far *selfptr;
909
    const char far *selfptr;
910
    char self[128], lang[8];
910
    char self[128], lang[8];
911
    selfptr = mdr_dos_selfexe();
911
    selfptr = mdr_dos_selfexe();
912
    if (selfptr != NULL) {
912
    if (selfptr != NULL) {
Line 917... Line 917...
917
    }
917
    }
918
  }
918
  }
919
 
919
 
920
  /* preload all slots with empty files */
920
  /* preload all slots with empty files */
921
  for (curfile = 9;; curfile--) {
921
  for (curfile = 9;; curfile--) {
922
    loadfile(&(dbarr[curfile]), "");
922
    loadfile(&(dbarr[curfile]), NULL);
923
    if (curfile == 0) break;
923
    if (curfile == 0) break;
924
  }
924
  }
925
 
925
 
926
  /* parse argv (and load files, if any passed on) */
926
  /* parse argv (and load files, if any passed on) */
927
  if (parseargv(dbarr) != 0) return;
927
  if (parseargv(dbarr) != 0) return;
Line 1066... Line 1066...
1066
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
1066
                ui_msg(svarlang_str(0,11), NULL, SCHEME_ERR); /* file not found */
1067
              } else {
1067
              } else {
1068
                ui_msg(svarlang_str(0,10), NULL, SCHEME_ERR);  /* ERROR */
1068
                ui_msg(svarlang_str(0,10), NULL, SCHEME_ERR);  /* ERROR */
1069
              }
1069
              }
1070
              mdr_bios_tickswait(44); /* 3s */
1070
              mdr_bios_tickswait(44); /* 3s */
1071
              loadfile(db, "");
1071
              loadfile(db, NULL);
1072
            }
1072
            }
1073
          }
1073
          }
1074
          uidirty.from = 0;
1074
          uidirty.from = 0;
1075
          uidirty.to = 0xff;
1075
          uidirty.to = 0xff;
1076
          uidirty.statusbar = 1;
1076
          uidirty.statusbar = 1;
Line 1102... Line 1102...
1102
          mdr_cout_cursor_show();
1102
          mdr_cout_cursor_show();
1103
          break;
1103
          break;
1104
 
1104
 
1105
        case MENU_CLOSE:
1105
        case MENU_CLOSE:
1106
          if (ui_confirm_if_unsaved(db) == 0) {
1106
          if (ui_confirm_if_unsaved(db) == 0) {
1107
            loadfile(db, "");
1107
            loadfile(db, NULL);
1108
          }
1108
          }
1109
          uidirty.from = 0;
1109
          uidirty.from = 0;
1110
          uidirty.to = 0xff;
1110
          uidirty.to = 0xff;
1111
          uidirty.statusbar = 1;
1111
          uidirty.statusbar = 1;
1112
          break;
1112
          break;