 
 (def browser (atom nil))
 
+(def browser-status (atom "Idle"))
+
 (def settings-window (atom nil))
 
 (def collections (atom nil))



(defn apply-data-and-settings [collection-name settings]
  (update-collection-menu collection-name)
  (set-last-collection-name collection-name)
  (let [table (@browser :table)

    (listen-to-open table)
    (attach-action-key search-field "ESCAPE" #(.setText search-field ""))
    (doto frame
      (.setBounds 50 50 620 500)
      (.addWindowListener
        (proxy [WindowAdapter] []
          (windowClosing [e]
            (println frame)
            (save-data-and-settings
              (get-last-collection-name)
                (get-current-data-and-settings))
            (.setVisible frame false)))))
    (gen-map frame table scroll-pane settings-button search-field
             collection-menu refresh-button)))

