Changeset 12115


Ignore:
Timestamp:
May 24, 2009, 4:40:31 AM (10 years ago)
Author:
mikel
Message:

Added a "Start Now" button to the preferences pane for the swank server, so that now we can start the Swank server from the preference pane without having to restart CCL, and without necessarily enabling it to start up at launch.

Location:
trunk/source/cocoa-ide
Files:
4 edited

Legend:

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

    r11466 r12115  
    99                        <dict>
    1010                                <key>showFontPanel</key>
     11                                <string>id</string>
     12                                <key>startSwankServer</key>
    1113                                <string>id</string>
    1214                        </dict>
  • trunk/source/cocoa-ide/preferences.lisp

    r11466 r12115  
    132132    (#/orderFrontFontPanel: font-manager self)))
    133133
     134(objc:defmethod (#/startSwankServer: :void) ((self preferences-window-controller)
     135                                         sender)
     136  (unless (or *ccl-swank-active-p*
     137              (try-starting-swank :force t))
     138    (alert-window :message "Unable to start the Swank server.")))
     139
    134140;;; This message is sent to the first responder, which is why
    135141;;; we do the *listener-or-editor* thing.
  • trunk/source/cocoa-ide/start.lisp

    r12104 r12115  
    8888    (require :swank))
    8989
    90 (defun try-starting-swank ()
     90(defun try-starting-swank (&key (force nil))
    9191  (unless *ccl-swank-active-p*
    9292    ;; try to determine the user preferences concerning the swank port number
     
    9696                       (serious-condition (c)
    9797                         (progn (format t "~%ERROR: Unable to get preferences from the Shared User Defaults Controller")
     98                                (force-output)
    9899                                nil))))
    99100           (start-swank-pref (and defaults (#/valueForKey: defaults #@"startSwankServer")))
    100101           (start-swank? (cond
     102                           ;; force is true, so we don't care about the user pref
     103                           (force t)
    101104                           ;; the user default is not initialized
    102105                           ((or (null start-swank-pref)
     
    113116                                           (format t "~%ERROR: Unrecognized value in user preference 'startSwankServer': ~S"
    114117                                                   start-swank-pref)
     118                                           (force-output)
    115119                                           nil))))
    116120                           ;; the user default value is incomprehensible
     
    118122                                (format t "~%ERROR: Unrecognized value type in user preference 'startSwankServer': ~S"
    119123                                        start-swank-pref)
     124                                (force-output)
    120125                                nil))))
    121126           (swank-port-pref (and defaults (#/valueForKey: defaults #@"swankPort")))
     
    134139                              (format t "~%Error starting swank server; the swank-port user preference is not a valid port number: ~S~%"
    135140                                      port-str)
     141                              (force-output)
    136142                              nil)))
    137143                         ;; the user default value is incomprehensible
     
    139145                              (format t "~%ERROR: Unrecognized value type in user preference 'swankPort': ~S"
    140146                                      swank-port-pref)
     147                              (force-output)
    141148                              nil)))))
    142149      (if (and start-swank? swank-port)
     
    152159              (setf *active-gui-swank-port* nil)
    153160              (format t "~%Error starting swank server: ~A~%" c)
     161              (force-output)
    154162              nil))
    155163          ;; don't try to start the swank server
     
    157165            (setf *ccl-swank-active-p* nil)
    158166            (setf *active-gui-swank-port* nil)
    159             nil)))
    160     (force-output)))
     167            nil)))))
    161168
    162169(defmethod toplevel-function ((a cocoa-application) init-file)
Note: See TracChangeset for help on using the changeset viewer.