Changeset 7140


Ignore:
Timestamp:
Sep 5, 2007, 3:54:26 AM (12 years ago)
Author:
gb
Message:

Don't call #/setFileName: when creating a Listener, since (a) that method's
deprecated in favor of #/setFileURL: and (b) a newly-created Listener doesn't
really have an associated filename, and so shouldn't get the icon and popup
in its titlebar.

Do arrange that (unless/until a listener document is saved to a file) its
window title is based on the underlying Hemlock buffer's name. (If one
ever attempts to save a listener document, the proposed file name is the
internal NSDocument name; we might or might not want to change that.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/cocoa-ide/cocoa-listener.lisp

    r7094 r7140  
    204204  (call-next-method))
    205205
     206(objc:defmethod #/windowTitleForDocumentDisplayName: ((self hemlock-listener-window-controller) name)
     207  (let* ((doc (#/document self)))
     208    (if (or (%null-ptr-p doc)
     209            (not (%null-ptr-p (#/fileURL doc))))
     210      (call-next-method name)
     211      (let* ((buffer (hemlock-document-buffer doc))
     212             (bufname (if buffer (hi::buffer-name buffer))))
     213        (if bufname
     214          (%make-nsstring bufname)
     215          (call-next-method name))))))
    206216
    207217
     
    272282                                    "Listener-~d" *cocoa-listener-count*)))
    273283             (buffer (hemlock-document-buffer doc)))
    274         (#/setFileName: doc  (%make-nsstring listener-name))
    275284        (setf (hi::buffer-pathname buffer) nil
    276285              (hi::buffer-minor-mode buffer "Listener") t
Note: See TracChangeset for help on using the changeset viewer.