def applyChanges(self):
     self.activeFile = self.inputFilesList.get(ACTIVE)
     try:
         utils.clearConfigFiles(self.master.lolPath)
     except OSError:
         pass
     if self.activeFile != "default input.ini file":
         try:
             utils.coppyFile(self.master.rootDir + "\input files\\" + self.activeFile,
                       self.master.lolPath + "\League of Legends\config\input.ini")
             self.outputText.set("settings sucsessfully applied\n")
         except IOError:
             self.outputText.set("ERROR! settings could not be applied. path to Riot Games folder is probably missconfigured")
    def setup(self):
        self.running = True

        self.activeFile="previously used file"

        # contents of variable is displayed by the bottom label
        self.outputText = StringVar()
        self.outputText.set("\n")

        # coppy input.ini file in lol config to lol settings manager input files
        try:
            utils.coppyFile(self.master.lolPath + "\League of Legends\Config\input.ini",
                                     self.master.rootDir + "\input files\previously used file")
        except IOError:
            self.outputText.set("NOTE! No input.ini file found in lol config folder. Either the file have been removed(no problem)\n or the path to the riotgames folder is misconfigured. Set the path to riotgames folder in settings ")
    

        # list containg name of all availible input files
        self.inputFiles = os.listdir(self.master.rootDir + "\input files")
    def refresh(self):
        # coppy input.ini file in lol config to lol settings manager input files
        try:
            utils.coppyFile(self.master.lolPath + "\League of Legends\Config\input.ini",
                            self.master.rootDir + "\input files\previously used file")
        except IOError:
            utils.makeFile(self.master.rootDir + "\input files\previously used file")
            self.outputText.set("NOTE! No input.ini file found in lol config folder. Either the file have been removed(no problem)\n or the path to the riotgames folder is misconfigured. Set the path to riotgames folder in settings ")

        # list containg name of all availible input files
        self.inputFiles = os.listdir(self.master.rootDir + "\input files")

        # refresh listbox
        self.inputFilesList.delete(0, END)
        self.inputFilesList.insert(END, "previously used file")
        self.inputFilesList.insert(END, "default input.ini file")
        for f in self.inputFiles:
            if f != "previously used file":
                self.inputFilesList.insert(END, f)

        self.activeFile="previously used file"