anchor.diff:      wxMenuItem:enable(ref_lookup(?SAVEAS_MENU_ITEM)).
   
   %% Export dialog
  -exportDialog(_Parent) ->
  -    io:format("Here..\n"),
  -    ok.
  -%    Caption = "Export to " ++ ?APP_STRING ++ " file",
  -%    Wildcard = ?APP_STRING ++ " files |*" ++ ?EXPORT_EXT,
  -%    DefaultDir = ref_lookup(?SNAPSHOT_PATH),
  -%    DefaultFile = "",
  -%    Dialog = wxFileDialog:new(Parent, [{message, Caption},
  -%                                       {defaultDir, DefaultDir},
  -%                                       {defaultFile, DefaultFile},
  -%                                       {wildCard, Wildcard},
  -%                                       {style, ?wxFD_SAVE bor
  -%                                            ?wxFD_OVERWRITE_PROMPT}]),
  -%    wxFileDialog:setFilename(Dialog, ?EXPORT_FILE ++ ?EXPORT_EXT),
  -%    case wxDialog:showModal(Dialog) of
  -%        ?wxID_OK -> snapshot_export(wxFileDialog:getPath(Dialog));
  -%        _Other -> continue
  -%    end,
  -%    wxDialog:destroy(Dialog).
  +exportDialog(Parent) ->
  +    Caption = "Save to " ++ ?APP_STRING ++ " file",
  +    Wildcard = "Text files |*" ++ ?EXPORT_EXT,
  +    DefaultDir = ".",
  +    DefaultFile = "",
  +    Dialog = wxFileDialog:new(Parent, [{message, Caption},
  +                                       {defaultDir, DefaultDir},
  +                                       {defaultFile, DefaultFile},
  +                                       {wildCard, Wildcard},
  +                                       {style, ?wxFD_SAVE bor
  +                                            ?wxFD_OVERWRITE_PROMPT}]),
  +    wxFileDialog:setFilename(Dialog, ?EXPORT_FILE),
  +    case wxDialog:showModal(Dialog) of
  +        ?wxID_OK ->
  +            AnalysisRet = ref_lookup(?ANALYSIS_RET),
  +            Output = wxFileDialog:getPath(Dialog),
  +            log:log("Writing output to file ~s..", [Output]),
  +            case concuerror:export(AnalysisRet, Output) of
  +                {'error', Msg} ->
  +                    log:log("~s\n", [file:format_error(Msg)]);
  +                ok ->
  +                    log:log("done\n")
  +            end;
  +        _Other -> continue
  +    end,
  +    wxDialog:destroy(Dialog).
   
   %% Return the directory path of selected module.
   getDirectory() ->
  
positive.code: loadPrefs(Options) ->
      %% Set initial file load path (used by the module addition dialog).
      ref_add(?FILE_PATH, ""),
      ref_add(?ANALYSIS_RET, undef),
      %% Set files
      case lists:keyfind('files', 1, Options) of
  
negative.code:     end.
  
  
  
  %%%----------------------------------------------------------------------
  %%% Main event loop
  