emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32fns.c [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/w32fns.c [emacs-unicode-2]
Date: Tue, 29 Jun 2004 13:07:43 -0400

Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.219.2.4 emacs/src/w32fns.c:1.219.2.5
*** emacs/src/w32fns.c:1.219.2.4        Mon Jun 28 07:29:24 2004
--- emacs/src/w32fns.c  Tue Jun 29 16:46:05 2004
***************
*** 7749,7755 ****
      {
        OFNOTIFY * notify = (OFNOTIFY *)lParam;
        /* Detect when the Filter dropdown is changed.  */
!       if (notify->hdr.code == CDN_TYPECHANGE)
        {
          HWND dialog = GetParent (hwnd);
          HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
--- 7749,7756 ----
      {
        OFNOTIFY * notify = (OFNOTIFY *)lParam;
        /* Detect when the Filter dropdown is changed.  */
!       if (notify->hdr.code == CDN_TYPECHANGE
!         || notify->hdr.code == CDN_INITDONE)
        {
          HWND dialog = GetParent (hwnd);
          HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
***************
*** 7763,7770 ****
            }
          else
            {
!             CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
!                                              "");
              EnableWindow (edit_control, TRUE);
            }
        }
--- 7764,7773 ----
            }
          else
            {
!             /* Don't override default filename on init done.  */
!             if (notify->hdr.code == CDN_TYPECHANGE)
!               CommDlg_OpenSave_SetControlText (dialog,
!                                                FILE_NAME_TEXT_FIELD, "");
              EnableWindow (edit_control, TRUE);
            }
        }
***************
*** 7786,7791 ****
--- 7789,7795 ----
    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
    char filename[MAX_PATH + 1];
    char init_dir[MAX_PATH + 1];
+   int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
  
    GCPRO5 (prompt, dir, default_filename, mustmatch, file);
    CHECK_STRING (prompt);
***************
*** 7809,7817 ****
        if (!file_name_only)
          file_name_only = full_path_name;
        else
!         {
!           file_name_only++;
!         }
  
        strncpy (filename, file_name_only, MAX_PATH);
        filename[MAX_PATH] = '\0';
--- 7813,7819 ----
        if (!file_name_only)
          file_name_only = full_path_name;
        else
!       file_name_only++;
  
        strncpy (filename, file_name_only, MAX_PATH);
        filename[MAX_PATH] = '\0';
***************
*** 7836,7841 ****
--- 7838,7852 ----
      file_details.nMaxFile = sizeof (filename);
      file_details.lpstrInitialDir = init_dir;
      file_details.lpstrTitle = SDATA (prompt);
+ 
+     /* If prompt starts with Dired, default to directories only.  */
+     /* A bit hacky, but there doesn't seem to be a better way to
+        DTRT for dired.  */
+     if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0)
+       default_filter_index = 2;
+ 
+     file_details.nFilterIndex = default_filter_index;
+ 
      file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
                          | OFN_EXPLORER | OFN_ENABLEHOOK);
      if (!NILP (mustmatch))
***************
*** 7848,7854 ****
        dostounix_filename (filename);
        if (file_details.nFilterIndex == 2)
          {
!           /* "Folder Only" selected - strip dummy file name.  */
            char * last = strrchr (filename, '/');
            *last = '\0';
          }
--- 7859,7865 ----
        dostounix_filename (filename);
        if (file_details.nFilterIndex == 2)
          {
!           /* "Directories" selected - strip dummy file name.  */
            char * last = strrchr (filename, '/');
            *last = '\0';
          }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]