/[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.219.2.4 by miles, Mon Jun 28 07:29:24 2004 UTC revision 1.219.2.5 by miles, Tue Jun 29 16:46:05 2004 UTC
# Line 7749  file_dialog_callback (hwnd, msg, wParam, Line 7749  file_dialog_callback (hwnd, msg, wParam,
7749      {      {
7750        OFNOTIFY * notify = (OFNOTIFY *)lParam;        OFNOTIFY * notify = (OFNOTIFY *)lParam;
7751        /* Detect when the Filter dropdown is changed.  */        /* Detect when the Filter dropdown is changed.  */
7752        if (notify->hdr.code == CDN_TYPECHANGE)        if (notify->hdr.code == CDN_TYPECHANGE
7753              || notify->hdr.code == CDN_INITDONE)
7754          {          {
7755            HWND dialog = GetParent (hwnd);            HWND dialog = GetParent (hwnd);
7756            HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);            HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
# Line 7763  file_dialog_callback (hwnd, msg, wParam, Line 7764  file_dialog_callback (hwnd, msg, wParam,
7764              }              }
7765            else            else
7766              {              {
7767                CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,                /* Don't override default filename on init done.  */
7768                                                 "");                if (notify->hdr.code == CDN_TYPECHANGE)
7769                    CommDlg_OpenSave_SetControlText (dialog,
7770                                                     FILE_NAME_TEXT_FIELD, "");
7771                EnableWindow (edit_control, TRUE);                EnableWindow (edit_control, TRUE);
7772              }              }
7773          }          }
# Line 7786  specified.  Ensure that file exists if M Line 7789  specified.  Ensure that file exists if M
7789    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
7790    char filename[MAX_PATH + 1];    char filename[MAX_PATH + 1];
7791    char init_dir[MAX_PATH + 1];    char init_dir[MAX_PATH + 1];
7792      int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
7793    
7794    GCPRO5 (prompt, dir, default_filename, mustmatch, file);    GCPRO5 (prompt, dir, default_filename, mustmatch, file);
7795    CHECK_STRING (prompt);    CHECK_STRING (prompt);
# Line 7809  specified.  Ensure that file exists if M Line 7813  specified.  Ensure that file exists if M
7813        if (!file_name_only)        if (!file_name_only)
7814          file_name_only = full_path_name;          file_name_only = full_path_name;
7815        else        else
7816          {          file_name_only++;
           file_name_only++;  
         }  
7817    
7818        strncpy (filename, file_name_only, MAX_PATH);        strncpy (filename, file_name_only, MAX_PATH);
7819        filename[MAX_PATH] = '\0';        filename[MAX_PATH] = '\0';
# Line 7836  specified.  Ensure that file exists if M Line 7838  specified.  Ensure that file exists if M
7838      file_details.nMaxFile = sizeof (filename);      file_details.nMaxFile = sizeof (filename);
7839      file_details.lpstrInitialDir = init_dir;      file_details.lpstrInitialDir = init_dir;
7840      file_details.lpstrTitle = SDATA (prompt);      file_details.lpstrTitle = SDATA (prompt);
7841    
7842        /* If prompt starts with Dired, default to directories only.  */
7843        /* A bit hacky, but there doesn't seem to be a better way to
7844           DTRT for dired.  */
7845        if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0)
7846          default_filter_index = 2;
7847    
7848        file_details.nFilterIndex = default_filter_index;
7849    
7850      file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR      file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
7851                            | OFN_EXPLORER | OFN_ENABLEHOOK);                            | OFN_EXPLORER | OFN_ENABLEHOOK);
7852      if (!NILP (mustmatch))      if (!NILP (mustmatch))
# Line 7848  specified.  Ensure that file exists if M Line 7859  specified.  Ensure that file exists if M
7859          dostounix_filename (filename);          dostounix_filename (filename);
7860          if (file_details.nFilterIndex == 2)          if (file_details.nFilterIndex == 2)
7861            {            {
7862              /* "Folder Only" selected - strip dummy file name.  */              /* "Directories" selected - strip dummy file name.  */
7863              char * last = strrchr (filename, '/');              char * last = strrchr (filename, '/');
7864              *last = '\0';              *last = '\0';
7865            }            }

Legend:
Removed from v.1.219.2.4  
changed lines
  Added in v.1.219.2.5

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