     public function ExporterController (win :ExporterWindow) {
         Log.setLevel("", Log.INFO);
         _win = win;
-        _errors = _win.errors;
-        _libraries = _win.libraries;
-
-        function updatePreviewAndExport (..._) :void {
-            _win.export.enabled = _exportChooser.dir != null && _libraries.selectionLength > 0 &&
-                _libraries.selectedItems.some(function (status :DocStatus, ..._) :Boolean {
-                    return status.isValid;
-            });
-
-            var status :DocStatus = _libraries.selectedItem as DocStatus;
-            _win.preview.enabled = status != null && status.isValid;
-
-            if (_exportChooser.dir == null) return;
-            _conf.exportDir = _confFile == null ? _exportChooser.dir.nativePath : _confFile.parent.getRelativePath(_exportChooser.dir, /*useDotDot=*/true);
-        }
+        _errorsGrid = _win.errors;
+        _librariesGrid = _win.libraries;
+
+
+
+        if (_settings.data.hasOwnProperty(CONF_FILE_KEY)) {
+            _confFile = new File(_settings.data[CONF_FILE_KEY]);
+            openConf();
+        }
+
+        var curSelection :DocStatus = null;
+        _librariesGrid.addEventListener(GridSelectionEvent.SELECTION_CHANGE, function (..._) :void {
+            log.info("Changed", "selected", _librariesGrid.selectedIndices);
+            updatePreviewAndExport();
+
+            if (curSelection != null) {
+                curSelection.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updatePreviewAndExport);
+            }
+            var newSelection :DocStatus = _librariesGrid.selectedItem as DocStatus;
+            if (newSelection != null) {
+                newSelection.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updatePreviewAndExport);
+            }
+            curSelection = newSelection;
+        });
+        _win.reload.addEventListener(MouseEvent.CLICK, F.callback(reloadNow));
+        _win.export.addEventListener(MouseEvent.CLICK, function (..._) :void {
+            for each (var status :DocStatus in _librariesGrid.selectedItems) {
+                exportFlashDocument(status);
+            }
+        });
+        _win.preview.addEventListener(MouseEvent.CLICK, function (..._) :void {
+            showPreviewWindow(_librariesGrid.selectedItem.lib);
+        });
+        _importChooser = new DirChooser(null, _win.importRoot, _win.browseImport);
+        _importChooser.changed.add(setImport);
+        _exportChooser = new DirChooser(null, _win.exportRoot, _win.browseExport);
+        _exportChooser.changed.add(reloadNow);
+
+        _importChooser.changed.add(F.callback(updateWindowTitle, true));
+        _exportChooser.changed.add(F.callback(updateWindowTitle, true));
+
+        var editFormats :EditFormatsWindow;
+        _win.editFormats.addEventListener(MouseEvent.CLICK, function (..._) :void {
+            if (editFormats == null || editFormats.closed) {
+                editFormats = new EditFormatsWindow();
+                editFormats.open();
+            } else editFormats.orderToFront();
+
+            var dataProvider :ArrayList = new ArrayList(_conf.exports);
+            dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, updateFromConf);
+
+            editFormats.exports.dataProvider = dataProvider;
+            editFormats.buttonAdd.addEventListener(MouseEvent.CLICK, function (..._) :void {
+                var export :ExportConf = new ExportConf();
+                export.name = "format" + (_conf.exports.length+1);
+                if (_conf.exports.length > 0) {
+                    export.format = _conf.exports[0].format;
+                }
+                dataProvider.addItem(export);
+            });
+            editFormats.exports.addEventListener(GridSelectionEvent.SELECTION_CHANGE, function (..._) :void {
+                editFormats.buttonRemove.enabled = (editFormats.exports.selectedItem != null);
+            });
+            editFormats.buttonRemove.addEventListener(MouseEvent.CLICK, function (..._) :void {
+                for each (var export :ExportConf in editFormats.exports.selectedItems) {
+                    dataProvider.removeItem(export);
+                }
+            });
+        });
+
+        updateFromConf();
+        updateWindowTitle(false);
+        _win.addEventListener(Event.CLOSE, function (..._) :void { NA.exit(0); });
+    }
+
+    protected function setupMenus () :void {
 
         var fileMenuItem :NativeMenuItem;
         if (NativeApplication.supportsMenu) {


    protected var _docFinder :Executor;
    protected var _win :ExporterWindow;
    protected var _libraries :DataGrid;
    protected var _errors :DataGrid;
    protected var _exportChooser :DirChooser;
    protected var _importChooser :DirChooser;
    protected var _authoredResolution :DropDownList;
    protected var _conf :FlumpConf = new FlumpConf();
    protected var _confFile :File;
    protected const _settings :SharedObject = SharedObject.getLocal("flump/Exporter");

    private static const log :Log = Log.getLog(ExporterController);

            fileMenuItem = _win.nativeWindow.menu.addSubmenu(new NativeMenu(), "File");
        }

        // Add save and save as by index to work with the existing items on Mac
        // Mac menus have an existing "Close" item, so everything we add should go ahead of that
        var newMenuItem :NativeMenuItem = fileMenuItem.submenu.addItemAt(new NativeMenuItem("New Project"), 0);
