def Load(self):
     ret = eve.Message(
         'CustomWarning', {
             'header':
             'Load Settings',
             'warning':
             'Note that you have to restart after loading new settings'
         }, uiconst.OKCANCEL)
     if ret == uiconst.ID_CANCEL:
         return
     path = settings.public.ui.Get('LoadSettingsPath', None)
     selection = uix.GetFileDialog(path=path,
                                   fileExtensions=['yaml'],
                                   multiSelect=False,
                                   selectionType=uix.SEL_FILES)
     if selection is None or len(
             selection.files) < 1 or selection.files[0] == '':
         return
     fileName = selection.files[0]
     folder = '\\'.join(fileName.split('\\')[:-1])
     save = eve.Message(
         'CustomQuestion', {
             'header': 'Save Current Settings?',
             'question': 'Do you want to save your current settings?'
         }, uiconst.YESNO)
     if save == uiconst.ID_YES:
         self.SaveCurrentSettings(folder)
     self.LoadSettings(fileName)
     settings.public.ui.Set('LoadSettingsPath', folder)
     appUtils.Reboot('Settings loaded')
def SaveRedFile(ball, graphicFile):
    dlgRes = uix.GetFileDialog(multiSelect=False,
                               selectionType=uix.SEL_FOLDERS)
    if dlgRes is not None:
        path = dlgRes.Get('folders')[0]
        graphicFile = graphicFile.split('/')[-1]
        graphicFile = graphicFile.replace('.blue', '.red')
        savePath = path + '\\' + graphicFile
        trinity.Save(ball.model, savePath)
        log.LogError('GM menu: Saved object as:', savePath)
 def Export(self):
     path = settings.public.ui.Get('LoadSettingsPath', None)
     selection = uix.GetFileDialog(path=path,
                                   multiSelect=False,
                                   selectionType=uix.SEL_FOLDERS)
     if selection is None or len(
             selection.folders) < 1 or selection.folders[0] == '':
         return
     folder = selection.folders[0]
     self.SaveCurrentSettings(folder)
     settings.public.ui.Set('LoadSettingsPath', folder)