<commit_before>import React from 'react';

import { Button, Checkbox, Grid, Header, Input, Form, Icon, Popup, Segment } from 'semantic-ui-react';
import SettingsPlugin from '../components/SettingsPlugin';
import SettingsItem from '../components/SettingsItem';

const { ipcRenderer, remote } = require('electron');

const { dialog } = remote;
const plugins = remote.getGlobal('plugins');
let config = remote.getGlobal('config');

class Settings extends React.Component {
  constructor() {
    super();
    this.state = {
      filesPath: config.Config.App.filesPath
    };
  }

  openDialog(e) {
    e.preventDefault();
    dialog.showOpenDialog(
      {
        properties: ['openDirectory']
      },
      dirName => {
        if (dirName) {
          this.setState({ filesPath: dirName.toString() });
          config.Config.App.filesPath = dirName.toString();
          ipcRenderer.send('updateConfig');
        }
      }
    );
  }

  render() {
    const folderLocations = ipcRenderer.sendSync('getFolderLocations');
    const pluginSettings = plugins.map((plugin, i) => {
      let description = plugin.pluginDescription ? (
        <Popup trigger={<Icon name="info circle" />} content={plugin.pluginDescription} size="small" />
      ) : (
        ''
      );

      return (<commit_msg>Fixed changing the directory for generated files, fixes #325<commit_after>import React from 'react';

import { Button, Checkbox, Grid, Header, Input, Form, Icon, Popup, Segment } from 'semantic-ui-react';
import SettingsPlugin from '../components/SettingsPlugin';
import SettingsItem from '../components/SettingsItem';

const { ipcRenderer, remote } = require('electron');

const { dialog } = remote;
const plugins = remote.getGlobal('plugins');
let config = remote.getGlobal('config');

class Settings extends React.Component {
  constructor() {
    super();
    this.state = {
      filesPath: config.Config.App.filesPath
    };
  }

  openDialog(e) {
    e.preventDefault();
    dialog
      .showOpenDialog({
        properties: ['openDirectory']
      })
      .then(result => {
        if (!result.canceled) {
          this.setState({ filesPath: result.filePaths.toString() });
          config.Config.App.filesPath = result.filePaths.toString();
          ipcRenderer.send('updateConfig');
        }
      });
  }

  render() {
    const folderLocations = ipcRenderer.sendSync('getFolderLocations');
    const pluginSettings = plugins.map((plugin, i) => {
      let description = plugin.pluginDescription ? (
        <Popup trigger={<Icon name="info circle" />} content={plugin.pluginDescription} size="small" />
      ) : (
        ''
      );

      return (
{'fraction_non_alphanumeric': 0.13974455296769348, 'fraction_numerical': 0.0011269722013523666, 'mean_word_length': 3.0348484848484847, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2446074', 'n_tokens_mistral': 740, 'n_tokens_neox': 734, 'n_words': 165}