     (core getProperty dev "Port")))
 
 (defn read-device-startup-settings
+  "Read all settings that will be necessary for restarting
+   a device."
   [dev]
   {:library-location (device-library-location dev)
    :pre-init-settings (pre-init-property-settings dev)

(def dll-directory-type (FileDialogs$FileType. "DLL Directory" "New DLL location" "" false nil))

(defn choose-dll-dir
  []
  (FileDialogs/openDir nil "Please choose a directory where new DLLs will appear"
                       dll-directory-type))

      (.add path-button))
    frame))

(defn show-plugin
  "Show the plugin at a given location."
  [app]
  (load-mm app)
  (when-not @control-frame
    (reset! control-frame (startup)))
  (.show @control-frame))

(defn handle-exit
  "Runs when application exits."
  []
  (stop))

;; testing

(defn test-lib
  "Get the first module with loaded devices."
  []
  (first (keys (devices-in-each-module))))

(defn test-unload
  "Attemt to unload a the test library."
  []
  (core unloadLibrary (test-lib)))
