/[emacs]/emacs/src/w32fns.c
ViewVC logotype

Diff of /emacs/src/w32fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.173.2.12 by miles, Tue Jul 6 09:39:56 2004 UTC revision 1.173.2.13 by miles, Tue Jul 6 10:23:40 2004 UTC
# Line 7686  file_dialog_callback (hwnd, msg, wParam, Line 7686  file_dialog_callback (hwnd, msg, wParam,
7686      {      {
7687        OFNOTIFY * notify = (OFNOTIFY *)lParam;        OFNOTIFY * notify = (OFNOTIFY *)lParam;
7688        /* Detect when the Filter dropdown is changed.  */        /* Detect when the Filter dropdown is changed.  */
7689        if (notify->hdr.code == CDN_TYPECHANGE)        if (notify->hdr.code == CDN_TYPECHANGE
7690              || notify->hdr.code == CDN_INITDONE)
7691          {          {
7692            HWND dialog = GetParent (hwnd);            HWND dialog = GetParent (hwnd);
7693            HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);            HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
# Line 7700  file_dialog_callback (hwnd, msg, wParam, Line 7701  file_dialog_callback (hwnd, msg, wParam,
7701              }              }
7702            else            else
7703              {              {
7704                CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,                /* Don't override default filename on init done.  */
7705                                                 "");                if (notify->hdr.code == CDN_TYPECHANGE)
7706                    CommDlg_OpenSave_SetControlText (dialog,
7707                                                     FILE_NAME_TEXT_FIELD, "");
7708                EnableWindow (edit_control, TRUE);                EnableWindow (edit_control, TRUE);
7709              }              }
7710          }          }
# Line 7723  specified.  Ensure that file exists if M Line 7726  specified.  Ensure that file exists if M
7726    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
7727    char filename[MAX_PATH + 1];    char filename[MAX_PATH + 1];
7728    char init_dir[MAX_PATH + 1];    char init_dir[MAX_PATH + 1];
7729      int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
7730    
7731    GCPRO5 (prompt, dir, default_filename, mustmatch, file);    GCPRO5 (prompt, dir, default_filename, mustmatch, file);
7732    CHECK_STRING (prompt);    CHECK_STRING (prompt);
# Line 7746  specified.  Ensure that file exists if M Line 7750  specified.  Ensure that file exists if M
7750        if (!file_name_only)        if (!file_name_only)
7751          file_name_only = full_path_name;          file_name_only = full_path_name;
7752        else        else
7753          {          file_name_only++;
           file_name_only++;  
         }  
7754    
7755        strncpy (filename, file_name_only, MAX_PATH);        strncpy (filename, file_name_only, MAX_PATH);
7756        filename[MAX_PATH] = '\0';        filename[MAX_PATH] = '\0';
# Line 7773  specified.  Ensure that file exists if M Line 7775  specified.  Ensure that file exists if M
7775      file_details.nMaxFile = sizeof (filename);      file_details.nMaxFile = sizeof (filename);
7776      file_details.lpstrInitialDir = init_dir;      file_details.lpstrInitialDir = init_dir;
7777      file_details.lpstrTitle = SDATA (prompt);      file_details.lpstrTitle = SDATA (prompt);
7778    
7779        /* If prompt starts with Dired, default to directories only.  */
7780        /* A bit hacky, but there doesn't seem to be a better way to
7781           DTRT for dired.  */
7782        if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0)
7783          default_filter_index = 2;
7784    
7785        file_details.nFilterIndex = default_filter_index;
7786    
7787      file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR      file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
7788                            | OFN_EXPLORER | OFN_ENABLEHOOK);                            | OFN_EXPLORER | OFN_ENABLEHOOK);
7789      if (!NILP (mustmatch))      if (!NILP (mustmatch))
# Line 7785  specified.  Ensure that file exists if M Line 7796  specified.  Ensure that file exists if M
7796          dostounix_filename (filename);          dostounix_filename (filename);
7797          if (file_details.nFilterIndex == 2)          if (file_details.nFilterIndex == 2)
7798            {            {
7799              /* "Folder Only" selected - strip dummy file name.  */              /* "Directories" selected - strip dummy file name.  */
7800              char * last = strrchr (filename, '/');              char * last = strrchr (filename, '/');
7801              *last = '\0';              *last = '\0';
7802            }            }

Legend:
Removed from v.1.173.2.12  
changed lines
  Added in v.1.173.2.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26