<commit_before>
/*
  Manipulates the state of all projects in the app. Handles adding and
  removing them from window.scout.projects. Also updating the project
  settings view.
*/

(function(){

    //This will change all UI elements for Project Settings back to an empty/default state
    function resetProjectSettingsUI () {
        $("#projectIcon").attr('src', '_img/logo_128.png');
        $("#projectName").html('');
        $("#projectFolder").val('');
        $("#inputFolder").val('');
        $("#inputFolderBrowse").attr('nwworkingdir','...');
        $("#inputFolderBrowse").val('');
        $("#outputFolder").val('');
        $("#outputFolderBrowse").attr('nwworkingdir','...');
        $("#outputFolderBrowse").val('');
        $("#outputWarning").addClass('hide');
        $('#environment input[data-argname="production"]').click();
        $($("#outputStyle option")[5]).prop("selected", true);
        $("#printConsole .alert, #printConsole .panel").addClass('hide');

        var newProject = {
            "projectID":     "",
            "projectFolder": "",
            "projectName":   "",
            "imageFolder":   "",
            "projectIcon":   "",
            "inputFolder":   "",
            "outputFolder":  "",
            "environment":   "production",
            "outputStyle":   "compressed",
            "indicator":     "play"
        };
        scout.newProject = newProject;
    }

    function deleteLocalSettingsFile (bool) {
        var appData = require('nw.gui').App.dataPath;
        var file = appData + '/scout-settings.json';
        if (process.platform == "win32") {
            file = appData + '\\scout-settings.json';
        }

        if (!bool) {
            console.info('To delete this file:');
            console.log(file);
            console.info('Run this function and pass in true. Like so:');
            console.log('scout.helpers.deleteLocalSettingsFile(true);');
            return;
        }

        if (bool) {
            ugui.helpers.deleteAFile(file);
            console.info('File Deleted');
        }
    }

    /**
     * Pass in the project ID starting with 'sa' to remove it
     * from the scout.projects array.
     *<commit_msg>Reload Scout-App after deleting settings file.<commit_after>
/*
  Manipulates the state of all projects in the app. Handles adding and
  removing them from window.scout.projects. Also updating the project
  settings view.
*/

(function(){

    //This will change all UI elements for Project Settings back to an empty/default state
    function resetProjectSettingsUI () {
        $("#projectIcon").attr('src', '_img/logo_128.png');
        $("#projectName").html('');
        $("#projectFolder").val('');
        $("#inputFolder").val('');
        $("#inputFolderBrowse").attr('nwworkingdir','...');
        $("#inputFolderBrowse").val('');
        $("#outputFolder").val('');
        $("#outputFolderBrowse").attr('nwworkingdir','...');
        $("#outputFolderBrowse").val('');
        $("#outputWarning").addClass('hide');
        $('#environment input[data-argname="production"]').click();
        $($("#outputStyle option")[5]).prop("selected", true);
        $("#printConsole .alert, #printConsole .panel").addClass('hide');

        var newProject = {
            "projectID":     "",
            "projectFolder": "",
            "projectName":   "",
            "imageFolder":   "",
            "projectIcon":   "",
            "inputFolder":   "",
            "outputFolder":  "",
            "environment":   "production",
            "outputStyle":   "compressed",
            "indicator":     "play"
        };
        scout.newProject = newProject;
    }

    function deleteLocalSettingsFile (bool) {
        var appData = require('nw.gui').App.dataPath;
        var file = appData + '/scout-settings.json';
        if (process.platform == "win32") {
            file = appData + '\\scout-settings.json';
        }

        if (!bool) {
            console.info('To delete this file:');
            console.log(file);
            console.info('Run this function and pass in true. Like so:');
            console.log('scout.helpers.deleteLocalSettingsFile(true);');
            return;
        }

        if (bool) {
            ugui.helpers.deleteAFile(file, function (){
                require('nw.gui').Window.get().reload();
            });
        }
    }

    /**
     * Pass in the project ID starting with 'sa' to remove it
     * from the scout.projects array.
     *
{'fraction_non_alphanumeric': 0.1700710479573712, 'fraction_numerical': 0.0026642984014209592, 'mean_word_length': 2.1350034794711203, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 3, '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': '2258457', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1234, 'n_words': 267}