import React from 'react'; import Modal from '../Modal'; import Emitter from '../../melodii/Events'; import { generate, saveTable } from '../Body/Table'; const Settings = window.require("electron-settings"); /** * The Extension of the Modal Class which is responsible for * dealing with the settings, and therefore named SettingsManager */ export default class SettingsManager extends Modal { constructor() { super(); this.template = { thead: { tr: ["Artist", "Title", "Album", "Year", "Genre", "Time"] //contains strings }, tbody: [] }; this.JSX =

Settings

; } render() { return( ); } deleteTable() { if (Settings.has("tableJSON")) Settings.delete("tableJSON"); else console.info("There was no Table Saved to Delete!"); const template = this.template; template.id = "-1"; //Impossible ID. Emitter.emit("newTable", this.template); } /** * Regenerates a Table * TODO: Make this a function w/ the one inside of Body.js */ async regenTable() { if (Settings.has("tableJSON")) Settings.delete("tableJSON"); else console.info("There was no Table Saved to Delete!") const tableJSON = await generate("C:\\Users\\Paoda\\Downloads", this.template); Emitter.emit("newTable", tableJSON); saveTable(tableJSON); } }