Changeset 12183


Ignore:
Timestamp:
Jun 2, 2009, 4:58:45 PM (10 years ago)
Author:
mikel
Message:

swank load removed
pref UI changed to reflect swank listener instead of swank
swank listener disabled until load-order bugs are resolved

Location:
trunk/source/cocoa-ide
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/preferences.nib/classes.nib

    r12116 r12183  
    1010                                <key>showFontPanel</key>
    1111                                <string>id</string>
    12                                 <key>startSwankServer</key>
     12                                <key>startSwankListener</key>
    1313                                <string>id</string>
    1414                        </dict>
  • trunk/source/cocoa-ide/preferences.lisp

    r12150 r12183  
    6464   (hyperspec-path-button :foreign-type :id :accessor hyperspec-path-button)
    6565   (listener-tab-view-item :foreign-type :id :accessor listener-tab-view-item)
    66    (swank-port-field :foreign-type :id :accessor swank-port-field)
    67    (swank-protocol-label :foreign-type :id :accessor swank-protocol-label)
     66   (swank-listener-port :foreign-type :id :accessor swank-listener-port)
    6867   (tab-view :foreign-type :id :accessor tab-view)
    6968   (toolbar :foreign-type :id :accessor toolbar))
     
    8584
    8685(eval-when (:compile-toplevel :load-toplevel :execute)
    87     (require :swank))
     86    (require :swank-listener))
    8887
    8988(objc:defmethod (#/windowDidLoad :void) ((self preferences-window-controller))
    9089  (let* ((window (#/window self))
    91          (swank-protocol-version swank::*swank-wire-protocol-version*)
    92          (protocol-label (swank-protocol-label self))
    93          (port-field (swank-port-field self))
    94          (swank-port (or (preference-swank-port) *default-gui-swank-port*)))
     90         (port-field (swank-listener-port self))
     91         (listener-port (or (preference-swank-listener-port) *default-swank-listener-port*)))
    9592    (with-slots (toolbar) self
    9693      (setf toolbar (make-instance 'ns:ns-toolbar
     
    10299      (#/setShowsToolbarButton: window nil)
    103100      (#/release toolbar))
    104     (ccl::with-autoreleased-nsstring (label-str (format nil "Swank protocol version: ~A" (or swank-protocol-version
    105                                                                                              "unknown")))
    106       (#/setStringValue: protocol-label label-str))
    107     (ccl::with-autoreleased-nsstring (port-string (format nil "~A" (or swank-port "")))
     101    (ccl::with-autoreleased-nsstring (port-string (format nil "~A" (or listener-port "")))
    108102      (#/setStringValue: port-field port-string))
    109103    (#/showAppearancePrefs: self +null-ptr+)))
     
    146140    (#/orderFrontFontPanel: font-manager self)))
    147141
    148 (objc:defmethod (#/startSwankServer: :void) ((self preferences-window-controller)
     142(objc:defmethod (#/startSwankListener: :void) ((self preferences-window-controller)
    149143                                         sender)
    150144  (declare (ignore sender))
  • trunk/source/cocoa-ide/start.lisp

    r12155 r12183  
    9191  (values nil nil nil nil))
    9292
    93 ;;; preference-start-swank? 
    94 ;;; returns the current value of the "Start swank server?" user
    95 ;;; preference
    96 (defun preference-start-swank? ()
    97   (with-autorelease-pool
    98    (let* ((defaults (handler-case (#/values (#/sharedUserDefaultsController ns:ns-user-defaults-controller))
    99                      (serious-condition (c)
    100                        (progn (log-debug "~%ERROR: Unable to get preferences from the Shared User Defaults Controller")
    101                               nil))))
    102          (start-swank-pref (if (and defaults (not (%null-ptr-p defaults)))
    103                                (#/valueForKey: defaults #@"startSwankServer")         
    104                                nil)))
    105     (cond
    106       ;; the user default is not initialized
    107       ((or (null start-swank-pref)
    108            (%null-ptr-p start-swank-pref)) nil)
    109       ;; examine the user default
    110       ;; intValue works on NSNumber or NSString
    111       ;; BUG? if a string value is not a valid representation of an integer,
    112       ;;      intValue returns 0, which means any non-numeric string will have the
    113       ;;      same effect as "0"
    114       ((or (typep start-swank-pref 'ns:ns-number)
    115            (typep start-swank-pref 'ns:ns-string))
    116        (case (#/intValue start-swank-pref)
    117          ;; don't start swank
    118          (0 nil)
    119          ;; start swank
    120          (1 t)
    121          ;; the user default value is incomprehensible
    122          (otherwise (progn
    123                       (log-debug "~%ERROR: Unrecognized value in user preference 'startSwankServer': ~S"
    124                                  start-swank-pref)
    125                       nil))))
    126       ;; the user default value is incomprehensible
    127       (t (progn
    128            (log-debug "~%ERROR: Unrecognized value type in user preference 'startSwankServer': ~S"
    129                       start-swank-pref)
    130            nil))))))
     93(eval-when (:compile-toplevel :load-toplevel :execute)
     94    (require :swank-listener))
    13195
    13296(defmethod toplevel-function ((a cocoa-application) init-file)
     
    136100    (#_ _exit -1))
    137101  (setq *standalone-cocoa-ide* t)
    138   (when (preference-start-swank?)
    139         (require :swank)
    140         (try-starting-swank))
     102  (maybe-start-swank-listener)
    141103  (with-slots  (have-interactive-terminal-io) ccl::*current-process*
    142104    (when (and (eql (nth-value 4 (ccl::%stat "/dev/null"))
Note: See TracChangeset for help on using the changeset viewer.